Skip to content

Instantly share code, notes, and snippets.

@ramonsmits
Created May 23, 2023 07:38
Show Gist options
  • Select an option

  • Save ramonsmits/447b2bfef912c8ed9865503e15079085 to your computer and use it in GitHub Desktop.

Select an option

Save ramonsmits/447b2bfef912c8ed9865503e15079085 to your computer and use it in GitHub Desktop.
TSQL: Create DROP TABLE queries for all tables in database
SELECT 'DROP TABLE ' + '[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'
FROM INFORMATION_SCHEMA.TABLES
ORDER BY TABLE_SCHEMA, TABLE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment