Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select correct database in procedure
Message
 
À
12/09/2011 07:14:03
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01523202
Message ID:
01523204
Vues:
38
>Hi
>
>I want to pass a database name into my stored procedure and then use that database for everything that the stored procedure does.
>
>Whats the syntax for that ?
>
>Thanks

You must use so called Dynamic SQL.
BTW why you need this?
If you call Database SP it will be executed for that DB, no matter to which DB you are connected.
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