I'm not getting success with this command
DECLARE @cmd sysname, @var sysname
SET @var = 'Hello world'
SET @cmd = 'echo ' + @var + ' > C:\var_out.txt'
EXEC master..xp_cmdshell @cmd
Already tried several examples, but it did not work. The command runs but the file simply does not create