DECLARE @cmd varchar(256), @var varchar(50)
SET @var = 'Hello world!' +CHAR(13)+CHAR(10)+ 'This is second line'
print @var
SET @cmd = 'echo>d:\myfile.txt ' + @var
EXEC master..xp_cmdshell @cmd, no_output
SET @var = 'Hello world!' +CHAR(13)+CHAR(10)+ 'This is second line'
print @var
SET @cmd = 'echo>d:\myfile.txt ' + @var
EXEC master..xp_cmdshell @cmd, no_output
No comments:
Post a Comment