存储过程是否能够从操作系统中删除文件? [英] Do stored procedures have the ability to delete a file from the OS?
本文介绍了存储过程是否能够从操作系统中删除文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
出于好奇,存储过程是否能够从操作系统中删除文件?
Out of curiosity, does a stored procedures have the ability to delete a file from the OS?
如果不是,我将不得不制作一个 Windows 批处理文件来删除文件,然后使用 OSQL 运行存储过程.
If not I will have to make a windows Batch file that deletes the file and then runs the stored procedure using OSQL.
推荐答案
从技术上讲,在正确的权限下,您可以执行 xp_cmdshell 向操作系统发出命令(或调用批处理文件,等等),但这可能不是一个好方法主意.如果您确实使用该方法,请对权限非常严格.
Technically, with the correct permissions, you could execute xp_cmdshell to issue commands to the OS (or call a batch file, whatever), but it's probably not a good idea. If you do use that method, be very strict about permissions.
为清晰起见进行了编辑.
Edited for clarity.
这篇关于存储过程是否能够从操作系统中删除文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文