Solved

Running .sql file from shell

Posted on 2001-06-13
4
271 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Error in WHERE Clause 5 39
SQL server is using more virtual memory. 5 68
Can someone plz fix this..getting an error 3 18
MS SQL Pivot table help 4 13
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now