Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wish item for the SQL Server
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01317384
Message ID:
01317388
Vues:
7
This message has been marked as the solution to the initial question of the thread.
>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.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform