Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

T-Sql calling an .exe is working but problem with space in the path

$
0
0
H everyone, I'm testing calling an .exe from T-Sql. Here is the code (whic his working btw:DECLARE @sqlCmd varchar(300)set @SqlCmd = 'powershell.exe Robocopy "C:\testSource" "c:\testDestination" *.bak /S'EXEC xp_cmdshell @sqlCmdProblem is though - if there is a space in the path name like say "C:\test Destination" - it throws an error like incorrect wrong parameter ie it thinks its a parameter for robocopy!Any assistance/help here to make it work much appreciated,J.

Viewing all articles
Browse latest Browse all 3145