I know this command will create a directory:
我知道这个命令会创建一个目录:
EXEC master.sys.xp_create_subdir 'C:\testing\'
But how do I check whether 'C:\testing\' exists?
但如何检查'C:\测试'是否存在?
IF EXISTS(...
1 个解决方案
#1
17
CREATE TABLE ResultSet (Directory varchar(200))
INSERT INTO ResultSet
EXEC master.dbo.xp_subdirs 'c:\'
Select * FROM ResultSet where Directory = 'testing'
Will return a list of sub directories, you can then check the contents of the list.
将返回一个子目录列表,然后您可以检查列表的内容。
#1
17
CREATE TABLE ResultSet (Directory varchar(200))
INSERT INTO ResultSet
EXEC master.dbo.xp_subdirs 'c:\'
Select * FROM ResultSet where Directory = 'testing'
Will return a list of sub directories, you can then check the contents of the list.
将返回一个子目录列表,然后您可以检查列表的内容。