Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java xp\u cmdshell在sql server中存储的过程_Java_Sql - Fatal编程技术网

Java xp\u cmdshell在sql server中存储的过程

Java xp\u cmdshell在sql server中存储的过程,java,sql,Java,Sql,我已将服务器映射到z: 因此,我尝试使用xp_cmdshell存储过程,使用下面的命令,从sql server 2005断开此映射驱动器的连接 exec sp_configure 'show advanced options', '1' reconfigure exec sp_configure 'xp_cmdshell','1' reconfigure exec xp_cmdshell 'net use z: /d /yes 我现在面临一个错误 network connection coul

我已将服务器映射到z:

因此,我尝试使用xp_cmdshell存储过程,使用下面的命令,从sql server 2005断开此映射驱动器的连接

exec sp_configure 'show advanced options', '1'
reconfigure
exec sp_configure 'xp_cmdshell','1'
reconfigure
exec xp_cmdshell 'net use z: /d /yes
我现在面临一个错误

network connection could not be found
但是,当我在命令提示符下执行命令“net use z:/d/yes”时,它执行成功,驱动器断开连接

请告诉我“xp\u cmd shell”存储过程有什么问题,请尝试此命令

net use z: /d /y
你也可以试试这个

 NET USE [driveletter:] /DELETE /Y

“如果您不想显示任何内容,请尝试net use*/d/y>nul”在您的案例中,net use z:/d/y>nulI已经尝试了所有类型,如“/d/y”、“/delete/y”、“/delete/yes”、“/d/yes”。它们都没有在存储过程中工作,但是thorugh cmd提示它们正在工作