07 Feb 2007
I hope we do not have such syntax in teradata SQL.Anyways, teradata automatically errs if the table being dropped does not exists.
for your satisfaction ,using bteq, you can query dbc.tvm table to check the existence of the table.use IF..Then conditional looping as below to drop the table ,if it exists
SELECT......FROM DBC.TVM;
If ACTIVITYCOUNT >0 THEN
DROP TABLE .....;
07 Feb 2007
You could set ignore and then drop, then reset the level:
.set maxerror 0;
.set errorlevel 3807 severity 0;
drop table foo;
.set errorlevel 3807 severity 8;
You must sign in to leave a comment.

Hi,
I can use the Drop Table "if exists" command in my SQL.
but when I use this command in Teradata I get an error message.
Is there any way I can drop a table only if it already exists in Teradata SQL Assistant 7.1?
Thanks