I want to delete all tables named error_log in all of my databases that have such a table.
truncate table error_log
I am using SQL Server 2000.
|
I want to delete all tables named
I am using SQL Server 2000. |
||||
|
|
|
In SQL Server 2000 you can do this using a cursor against sysdatabases and building a check against each db's sysobjects table for the
In SQL Server 2005 and up, you can do this without the explicit cursor (and using the more modern catalog views), but in 2000 this method would not be safe - depending on how many databases you have you would risk exceeding 4000 characters, and you can't use a MAX type in SQL Server 2000 (or declare TEXT/NTEXT as a local variable):
|
|||||||||||
|