Hi all,
To delete all tables from a database, I used this query
EXEC sp_MSforeachtab le @command1 = "DROP TABLE ?"
It worked fine.
But this is not a rollback one, I have to manually clear the drop table command from the command prompt using this query. But its not working.Can anyone help me?
EXEC xp_cmdshell 'SQLCMD -U sa -P Admin@fih -Q 'EXEC sp_MSforeachtab le @command1 = "DROP TABLE ?"', no_output'
I'm getting following error message
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ', no_output'.
To delete all tables from a database, I used this query
EXEC sp_MSforeachtab le @command1 = "DROP TABLE ?"
It worked fine.
But this is not a rollback one, I have to manually clear the drop table command from the command prompt using this query. But its not working.Can anyone help me?
EXEC xp_cmdshell 'SQLCMD -U sa -P Admin@fih -Q 'EXEC sp_MSforeachtab le @command1 = "DROP TABLE ?"', no_output'
I'm getting following error message
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ', no_output'.
Comment