脚本导入

EXEC sp_configure 'show advanced options', 1 GO

-- 重新配置

RECONFIGURE GO

-- 启用

xp_cmdshell EXEC sp_configure 'xp_cmdshell', 1 GO

--重新配置

RECONFIGURE GO

exec master..xp_cmdshell 'osql -S 127.0.0.1,1433 -d db -U sa -P xxx -i E:scriptscript.sql'

原文地址:https://www.cnblogs.com/cry/p/5139735.html