[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Running .sql file from shell

Posted on 2001-06-13
4
Medium Priority
?
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 75 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

649 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