Solved

Running .sql file from shell

Posted on 2001-06-13
4
274 Views
Last Modified: 2006-11-17
Hi
How can i run a .sql file from a shell(dos prompt)
Thanks
0
Comment
Question by:Dishank
  • 2
4 Comments
 
LVL 2

Expert Comment

by:ZhongYu
ID: 6185175
Hi

You can use isql or osql. Please check with online book for detail.



 
0
 

Expert Comment

by:vivekkj
ID: 6189913

like if seervername is "servername"
sql server login is "sa"
password is "password"
database is "databasename"
and your .sql file name is "test.sql"

Go to command prompt and type
 osql -Sservername -Usa -Ppassword -itest.sql -ddatabasename

This will execute whatever is there in your .sql file.

0
 

Accepted Solution

by:
vivekkj earned 25 total points
ID: 6189915
like if seervername is "servername"
sql server login is "sa"
password is "password"
database is "databasename"
and your .sql file name is "test.sql"

Go to command prompt and type
osql -Sservername -Usa -Ppassword -itest.sql -ddatabasename

This will execute whatever is there in your .sql file.

0
 

Author Comment

by:Dishank
ID: 6193950
Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question