本机上运行能够完成,但是在其他电脑上却提示错误,特来请教..使用xp_cmdshell的SQL语句:EXEC master..xp_cmdshell 'osql -S 192.168.1.10 -U sa -P sa -d tmpPOS -i E:\DB\1.sql'本机上可以运行,放其他电脑除E:\DB\1.sql这里的SQL存放路径发生变化外其他都不变.执行返回错误:Cannot open input file - E:\DB\1.sql
No such file or directory
但是如果单独在其他电脑上运行osql -S 192.168.1.10 -U sa -P sa -d tmpPOS -i E:\DB\1.sql这一句是成功的,放在SQL中就产生了错误.是不是我遗漏了哪里?求教...谢谢!
No such file or directory
但是如果单独在其他电脑上运行osql -S 192.168.1.10 -U sa -P sa -d tmpPOS -i E:\DB\1.sql这一句是成功的,放在SQL中就产生了错误.是不是我遗漏了哪里?求教...谢谢!
2、xp_cmdshell 开没。
2.你是说我运行的客户端?
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
GO
RECONFIGURE
GO
EXEC sys.sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GO
EXEC master..xp_cmdshell 'osql -S 192.168.1.10 -U sa -P sa -d tmpPOS -i E:\DB\1.sql'
GO
EXEC sys.sp_configure 'show advanced options',1
GO
RECONFIGURE
GO
EXEC sys.sp_configure 'xp_cmdshell',0
GO
完整的...我都写了的
执行下面的语句:EXEC xp_cmdshell 'dir *.exe'
执行成功....