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.
| Author |
Topic |
|
modraj
Starting Member
1 Post |
Posted - 2009-07-20 : 15:54:53
|
| How can I run a program1.sql file stored under my local directory c:\db\prog. The script contains certain select statement and a table creation script. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Mangal Pardeshi
Posting Yak Master
110 Posts |
Posted - 2009-07-21 : 02:29:05
|
As suggested by Tara, you can use sqlcmd or just open the file in management studio and run it.here example using sqlcmdUsing sql authenticationxp_cmdshell 'Sqlcmd -S Servername -U suername -P password -i C:\filename.sql' for using windows authentication replace -U and -P with Esee http://msdn.microsoft.com/en-us/library/ms162773.aspxMangal Pardeshihttp://mangalpardeshi.blogspot.com |
 |
|
|
|
|
|