Need to rename a .txt file saved in a folder within a Mapped drive
Examble ,
DECLARE @cmd varchar(2000)
DECLARE @C_Date Date = getdate()
Declare @DateasText as varchar(100) = @C_Date
SET @cmd = 'rename \Server1\Folder\Text.txt Text'+@DateasText+'.txt'
EXEC master..xp_cmdshell @cmd
- i get the below error
- output
- The syntax of the command is incorrect.