Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I want to execute one stored procedure on different sets of database.
How can i run it from Dos command?Regards
Nehal


I got some answer .i.e. i can use sqlcmd to run sql script from my dos command window.
Let me be more specific about requirement:
I have say couple of sql files (variable) which needs to be executed on batch of database (variable).
For sql files (variable) - 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.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 ?

might want to start here with the sqlcmd. You will have to figure out how to pipe lines from a cmd procedure to sqlcmd.
I would suggest the tact of making a stored procedure and scheduling it but below will get you started on sqlcmdGoogle is your friend btw

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |