Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to Create a batch file which runs sets of sql files on different database Expand / Collapse
Author
Message
Posted Friday, October 30, 2009 6:39 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 11, 2009 10:44 PM
Points: 1, Visits: 3
I have say couple of sql files which needs to be executed on batch of database (variable).
For sql files - i will keep this files in one local folder.
For database (variable) - i will keep the information about dbs and their server in one txt file.
Variable - Different databases from different servers.

Now i want to create one batch file i.e *.bat which will execute 'sqlcmd' picking up *.sql files from folder and database information from the txt file.

How can i achieve this ?

Note: I would not like to use 'SET' command.
Post #811515
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse