May 12, 2008 #1 equus2 Programmer Joined Mar 5, 2008 Messages 36 Location US When I run this from Mgmt Studio: EXEC master..xp_cmdshell 'DEL C:\mypath\*.master.*' GO It gives this message: Could Not Find C:\mypath\*.master.* Runs fine from my job... What is the problem here? Thanks
When I run this from Mgmt Studio: EXEC master..xp_cmdshell 'DEL C:\mypath\*.master.*' GO It gives this message: Could Not Find C:\mypath\*.master.* Runs fine from my job... What is the problem here? Thanks
May 12, 2008 Thread starter #2 equus2 Programmer Joined Mar 5, 2008 Messages 36 Location US Actually nevermind --- file wasn't there - duh Upvote 0 Downvote
May 12, 2008 1 #3 gmmastros Programmer Joined Feb 15, 2005 Messages 14,912 Location US You can use xp_fileexist to determine if a file exists. Code: Declare @FileExists Int Exec master..xp_fileexist 'C:\YourFileName.ext', @FileExists Out Select @FileExists @FileExists = 1 if the file exists. Otherwise it is 0. -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom Upvote 0 Downvote
You can use xp_fileexist to determine if a file exists. Code: Declare @FileExists Int Exec master..xp_fileexist 'C:\YourFileName.ext', @FileExists Out Select @FileExists @FileExists = 1 if the file exists. Otherwise it is 0. -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom