Have you tried simply replacing all "s with ""s yet?
Kynan C
-----Original Message-----
From: Mirabella Derek [mailto:mssqldba-ezmlmshield-x98720575.[Email address protected]
Sent: Wednesday, February 28, 2007 9:40 AM
To: LazyDBA Discussion
Subject: " quotes to appear in t-sql
I am trying to shell out to dos and execute a simple ftp command, the
problem is, when I run this statement through dos it works fine, when I
try to execute through a job, or t-sql I am getting an error
"C:\Program Files\WS_FTP Pro\wsftppro.exe" -s "Shared Sites!User
Sites!MYFTPSERVER:/e:/e:/backup_mp" -d "local:F:\prod_backups\"
Here is my code
SET NOCOUNT ON
declare @DOSCommand varchar(150)
set @DOSCommand = '"C:\Program Files\WS_FTP Pro\wsftppro.exe" -s "Shared
Sites!User Sites!MYFTPSERVER:/e:/e:/backup_mp" -d
"local:F:\prod_backups\"'
print @DOSCommand
exec master..xp_cmdshell @DOSCommand
I have a feeling it has something to do with the "s
Because the results showing in QA are as follows
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NULL
There should be a double quote in front of the C:\ not a single
Any help would greatly be appreciated
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page