Hi,
i'm trying to automatize some tasks for each table, but this piece of code doesn't work :
...
DECLARE @.TableName sysname
...
drop table @.TableName ( or whatever ... )
...
...
the error message is: " Incorrect syntax near '@.TableName' "
Thanks !Try using EXECUTE command:
DECLARE @.TableName sysname
exec ('drop table ' + @.TableName )
Showing posts with label sysname. Show all posts
Showing posts with label sysname. Show all posts
Sunday, March 11, 2012
automatic code for each table - dont work
Hi,
i'm trying to automatize some tasks for each table, but this piece of code doesn't work :
...
DECLARE @.TableName sysname
...
drop table @.TableName ( or whatever ... )
...
...
the error message is: " Incorrect syntax near '@.TableName' "
Thanks !
:confused:try:
exec('drop table ' + @.TableName)|||Works! Thanx for help !
regards.
i'm trying to automatize some tasks for each table, but this piece of code doesn't work :
...
DECLARE @.TableName sysname
...
drop table @.TableName ( or whatever ... )
...
...
the error message is: " Incorrect syntax near '@.TableName' "
Thanks !
:confused:try:
exec('drop table ' + @.TableName)|||Works! Thanx for help !
regards.
Subscribe to:
Posts (Atom)