December 14, 2010 at 12:45 am
Hi All,
Please help me in this.
I am trying to read file names in my local drive using XP_CMDSHELL.
Below is the query i am using to read the file name.
SELECT @ServerName = 'MyServer'
SELECT @SourceFolder = 'L:\SQL2008_Backup\Full Backup
SELECT @Cmd = 'master..xp_cmdshell ''DIR ' + @SourceFolder + ' /B'''
By executing this i m getting the below error.
-----------------
File Not Found
-----------------
I feels its because of space in the folder name [Full Backup].
please provide me the solution to reslove this issue.
Thanks in advance.
Regards,
Vijay
December 14, 2010 at 1:06 am
Got it..
Below query works.:-)
SELECT @SourceFolder = '"L:\SQL2008_Backup\Full Backup"'
April 26, 2011 at 3:32 pm
using CLR procedure, much more secure,robust free and extensible solution here
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply