Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Executing a SQL script from a tex file

Author  Topic 

sudha12345
Starting Member

47 Posts

Posted - 2009-06-08 : 08:58:21
I has a SQL script with name and extension Facility_detail.sql.

i want to execute this sql file from a text file


in a text file i will incorporate the sql script and i want to call the text file in SQL SERVER so that it will execute the sql file
Facility_detail.sql

is it possible to do this. can any one give me the solution



Sudhakar

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-08 : 09:01:48

Read about osql in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Gene Lowy
Starting Member

1 Post

Posted - 2009-06-08 : 09:19:38
Try this

osql -U username -P pwd -S Server -i c:\YourDir\Facility_Detail.sql

There are other options available from osql but this will get you started
Go to Top of Page
   

- Advertisement -