1.

Solve : How to run stored procedure from dos command?

Answer»

Hi

I have to run couple of stored procedure on different databases.
I want to automate this process.

How can i run stored procedure from Dos COMMAND.

Regards
NehalMore information needed:

1.) What database type.

2.) What instructons do you want to execute.1) Its a SQL 2008 server databases.
2) Apply stored procedure to this databases. It could be new, amendments etc.
Quote from: NehalShah on OCTOBER 29, 2009, 06:12:48 AM

Hi

I have to run couple of stored procedure on different databases.
I want to automate this process.

How can i run stored procedure from Dos Command.

Regards
Nehal

no matter what database you are using, mysql, sql server , sybase etc, they COME with documentations. The first thing you should do is read them and see how to execute stored proc from the command line. Appriciate your promt reply.
I could find sqlcmd utility and will explore more on this.

Yes BASICALLY they are SQL statements i.e. *.sql file which i normally execute on batch of databases.

Comming to more specific 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
Information on this will be much appriciated.


Discussion

No Comment Found