Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF EXISTS (
- SELECT 1
- FROM sysobjects
- WHERE name = 'a_table'
- AND type = 'U'
- )
- DROP TABLE a_table
- GO
- IF NOT EXISTS (
- SELECT 1
- FROM sysobjects
- WHERE name = 'a_table'
- AND type = 'U'
- )
- CREATE TABLE a_table (
- col1 int not null,
- col2 int null
- )
- GO
- IF NOT EXISTS (
- SELECT 1
- FROM sysobjects
- WHERE name = 'a_table'
- AND type = 'U'
- )
- EXECUTE("CREATE TABLE a_table (
- col1 int not null,
- col2 int null
- )")
- GO
- IF(SELECT count(*) FROM sysobjects WHERE name="tableNameWithoutUserPart") > 0
- DROP TABLE tableNameWithUserPart
- GO
- CREATE TABLE tableNameWithUserPart ...
- IF object_id('a_table') IS NULL
- BEGIN
- CREATE TABLE a_table (
- col1 int not null,
- col2 int null
- )
- END
Add Comment
Please, Sign In to add comment