SQL Server 调用本地的*.sql文件

osql -S pc-bdk -U sa -P sa123 -i d:\1.sql -d

 

 

请注意大小写

 

 

use master
exec  master.dbo.sp_configure 'xp_cmdshell', 1
reconfigure
exec sp_configure 'show advanced options', 1
reconfigure
exec   master.dbo.xp_cmdshell   'osql -S pc-bdk -U sa -P sa123 -i d:\1.sql -d'   

 

 

你可能感兴趣的:(sql,SQL Server,XP)