Dear all,
I have a .sql file which contains several stored procedures used for report
generation, and I know how to insert/import it into sql server database by
Management Studio.
My question is how can I do the same action using command line syntax, like
......
backup database ABC to disk='........'
......
because I plan to use DOS batch file to run it.
Thanks.
lurc
Uri Dimant - 31 Jul 2008 10:08 GMT
Hi
EXEC master..xp_cmdshell 'osql.exe -S SERVER -U sa -P pass -dNorthwind -i
"D:\ORD1.sql"'
> Dear all,
>
[quoted text clipped - 13 lines]
>
> lurc
vinu - 31 Jul 2008 10:48 GMT
hi
to add to Uri's post if you using SQL 2005, then use sqlcmd.exe, see bol for
more info

Signature
vinu
http://oneplace4sql.blogspot.com/
> Hi
> EXEC master..xp_cmdshell 'osql.exe -S SERVER -U sa -P pass -dNorthwind -i
[quoted text clipped - 17 lines]
>>
>> lurc
amish - 31 Jul 2008 15:24 GMT
> Dear all,
>
[quoted text clipped - 12 lines]
>
> lurc
If you are using SQL Server 2005 you can use SQLCMD.
Amish Shah
http://shahamishm.blogspot.com