Computing.Net > Forums > Windows XP > How to run stored procedure from dos command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to run stored procedure from dos command

Reply to Message Icon

Name: Nehal
Date: October 29, 2009 at 05:24:55 Pacific
OS: Windows XP
Product: Microsoft Windows xp professional edition
Subcategory: General
Comment:

Hi,

I want to execute one stored procedure on different sets of database.
How can i run it from Dos command?

Regards
Nehal



Sponsored Link
Ads by Google

Response Number 1
Name: wanderer
Date: October 29, 2009 at 08:46:32 Pacific
Reply:

You don't. There is no dos only a cmd shell. You have to connect to the database to run transact.

http://msdn.microsoft.com/en-us/lib...


-1

Response Number 2
Name: Nehal
Date: October 30, 2009 at 01:58:37 Pacific
Reply:

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 ?


0

Response Number 3
Name: wanderer
Date: October 30, 2009 at 06:43:19 Pacific
Reply:

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 sqlcmd

Google is your friend btw

http://msdn.microsoft.com/en-us/lib...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: How to run stored procedure from dos command

How to 'Run as...' admin from cmd.e www.computing.net/answers/windows-xp/how-to-run-as-admin-from-cmde/94587.html

How to boot server 2003 from dos? www.computing.net/answers/windows-xp/how-to-boot-server-2003-from-dos/174073.html

How to run XP apps from a DOS sessi www.computing.net/answers/windows-xp/how-to-run-xp-apps-from-a-dos-sessi/102542.html