Last active
August 29, 2015 14:09
-
-
Save BryanWilhite/b07cc28a6bad426a0e07 to your computer and use it in GitHub Desktop.
t-SQL: CREATE TABLE preamble
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 EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[MyTable]') | |
AND OBJECTPROPERTY(id, N'IsUserTable') = 1) --also: type = 'U' | |
BEGIN | |
DROP TABLE [dbo].[MyTable] | |
END | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment