Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting a loop in SSMS
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01608757
Message ID:
01608758
Vues:
36
>Hi,
>
>I want to write a script to restore a number of databases from a backup folder. So I would like to store the names of .BAK file names into an array and then process them, one at a time. How do you create an array (or an equivalent) in T-SQL? And then How do you set up a FOR loop?
>
>TIA.

There is no array in SQL Server. You can pass table variable (if you're using the SQL 2008 and up) and process it using CURSOR's code row by row.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform