Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wish item for the SQL Server
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01317384
Message ID:
01317392
Views:
12
>>Hi everybody,
>>
>>When I generate CREATE TABLE script it would be nice that it would add a check for the existance of the table.
>>
>>Do you remember the syntax?
>>
>>Thanks in advance.
>
>
>IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[TableNameHere]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
>  -- Table does not exists
>
>
>In Tools->Options click on Scripting node and set Include IF NOT EXISTS clause to true.

Wow, thanks a lot.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform