Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Created .sql scripts from scripts
Message
 
 
À
20/01/2010 09:27:58
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01444928
Message ID:
01445016
Vues:
25
>I have four scripts that use metadata and PRINT commands to create scripts that perform alterations on a database schema and data.
>
>Currently the output is going to a message window, i am cutting and pasting into a new query and running the result.
>
>I would like to have each "creation" script put its output into a new script.
>
>The goal is to consolidate the four "creation" scripts into one, and have each of the four batches within that script create its own .sql file ( the name and location would remain fixed with automatic overwrite ) and then to run those four scripts in sequence.
>
>I see that I can point the results of a query to file rather than the message window but don't see how to do that programmatically in T-SQL
>
>As always, guidance appreciated.

See also

http://forum.lessthandot.com/viewtopic.php?f=17&t=9614&p=47783 - though I can not get the last code work for me right now (I would have to allow xp_cmdShell).
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform