Created
September 3, 2014 18:36
-
-
Save aguynamedryan/50f7083c95fb23ece839 to your computer and use it in GitHub Desktop.
Creating a schema if it doesn't exist using TSQL
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
IF NOT EXISTS ( | |
SELECT name | |
FROM sys.schemas | |
WHERE name = 'schema' ) | |
BEGIN | |
EXEC sp_executesql N'CREATE SCHEMA schema' | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment