[Note: After I loaded up my server with hundreds of thousands of queued messages, I discovered an annoying default setting in Windows that you should know about. The blog post/article […]
With 260+ tables that I created in VB.NET code via SMO to delete, I did it by first creating a DROP TABLE statement using:
declare @SQL nvarchar(max)
SELECT @SQL = STUFF((SELECT ', ' + quotename(TABLE_SCHEMA) + '.' + quotename(TABLE_NAME)
FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name LIKE 'c_%'
FOR XML PATH('')),1,2,'')
SET @SQL = 'DROP TABLE ' + @SQL
You create a tidy DROP […]