Archives of the TeradataForum
Message Posted: Sun, 21 Dec 2003 @ 13:26:08 GMT
Subj: | | Re: Suggestions for checking whether table exists or not |
|
From: | | Ferry, Craig |
Since you are dropping it, I'm assuming it is a real and not a volatile table.
I do the following in my bteq scripts for this purpose.
SELECT *
FROM dbc.tables
WHERE databasename = 'my_database'
AND tablename = 'my_table';
.IF ACTIVITYCOUNT = 0 then .GOTO CONTINUE
DROP TABLE my_database.my_table;
.LABEL CONTINUE
CREATE TABLE my_database.my_table....
|