Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scripting Triggers and Indexes
Message
De
17/08/2001 11:35:21
 
 
À
17/08/2001 10:53:20
Information générale
Forum:
Visual Basic
Catégorie:
SQL Server
Divers
Thread ID:
00545339
Message ID:
00545386
Vues:
10
>How can i script all Triggers and Indexes of my db in a vb procedure? i want to generate a script that drop and recreate my triggers and indexs.
>
>for the Views i can use this command :
>
>TheCommand = TheCommand & test.Database(txtDB.Text).Views(X).Script(SQLDMOScript_Default Or SQLDMOScript_Drops)
>
>But there is no such command for the triggers and indexes.
>
>the command i have for the triggers is :
>
>TheCommand = TheCommand & test.Database(txtDB.Text).Tables(X).Script(SQLDMOScript_Triggers)

I believe you have to script those individually (for each table) with something like:
lOptions1 = SQLDMOScript_Default + SQLDMOScript_Drops
For Each oIndex In oTable.Indexes
   TheCommand = oIndex.Script(lOptions1)
Next
..
For Each oTrigger In oTable.Triggers
.. Etc.
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform