-
-
Save adityadeshpande/e797fd5cc3e5d0610a4afbf89da23c7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SqlCmd NVARCHAR(MAX) | |
SELECT @SqlCmd = COALESCE(@SqlCmd + CHAR(10), '') + N'TRUNCATE TABLE ' + QUOTENAME(s.name) + '.' + QUOTENAME(t.name) + ';' | |
FROM sys.tables t | |
INNER JOIN sys.schemas s ON s.schema_id = t.schema_id | |
WHERE t.[name] <> 'sysdiagrams' | |
AND t.is_ms_shipped = 0 | |
PRINT @SqlCmd | |
EXEC sp_executesql @SqlCmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment