I'm wondering whats the syntax to execute the following sql statement?
declare @i as integer
exec @i = master..xp_cmdshell 'dir \"E:\Adept Technologies\Documents\Building\B07-100001\B07-100001_Expired*.doc\" /b'
if @i <> null
print 'File does exist'
print 'file does not exist'
What I'm trying to do is to see if a file exist in a certain directory, the things that I have encounter if the directory has a space the statement doesn't return a true value.
I need create the directory path dynamically, what I mean is to search on a directory that looks like this
lding\ + NumberKey +'/' + 'Filename' How can I achieved this?