如何解决xp_cmdshell访问被拒绝的错误?

时间:2019-10-29 10:53:06

标签: sql-server tsql

我尝试使用exec XP_CMDSHELL'dir / B C:\ Users \ pc \ Desktop \ images \ images2 \ items * .jpg'从文件夹中获取图像名称;

输出高于

enter image description here

我在此链接https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql?view=sql-server-ver15中尝试过解决方案

sp_configure 'xp_cmdshell',1 
reconfigure with override

GRANT EXECUTE ON xp_cmdshell TO [user]

EXEC sp_xp_cmdshell_proxy_account 'user', 'password'

create credential ##xp_cmdshell_proxy_account## with identity = 'user', secret = 'password

'

我想在我的sql server中打开文件夹名称并存储在自定义表格中。

0 个答案:

没有答案