|
|
| |

How do I run SQL script located on the disk file, using Transact-SQL?
Answer:
You can use osql or isql utility to run SQL script located on the disk file.
This is the example to run SQL script located in the C:\SQLScript.sql file:
EXEC master..xp_cmdshell 'osql -S Servername -U sa -P -ic:\SQLScript.sql'
See SQL Server Books Online for more information about osql or isql
utility and about xp_cmdshell extended stored procedure.
|
|
|