DECLARE @cmd sysname, @var varchar(max)
SET @var = 'Hello world !!'
SET @cmd = 'echo ' + @var + ' > c:\pravin\test.htm'
EXEC master..xp_cmdshell @cmd
when I use above query in sql server 2005, it gives me desired result, but when I use the same query with some changes that I tried to transoport tagged data to one html file like,
DECLARE @cmd sysname, @var varchar(max)
SET @var = '[red]<[/red]Hello world !![red]>[/red]'
SET @cmd = 'echo ' + @var + ' > c:\pravin\test.htm'
EXEC master..xp_cmdshell @cmd
it gives me following error,
output
----------------------------------
> was unexpected at this time.
NULL
Will any body please help asap,
Thanks in advance,
Praveen
SET @var = 'Hello world !!'
SET @cmd = 'echo ' + @var + ' > c:\pravin\test.htm'
EXEC master..xp_cmdshell @cmd
when I use above query in sql server 2005, it gives me desired result, but when I use the same query with some changes that I tried to transoport tagged data to one html file like,
DECLARE @cmd sysname, @var varchar(max)
SET @var = '[red]<[/red]Hello world !![red]>[/red]'
SET @cmd = 'echo ' + @var + ' > c:\pravin\test.htm'
EXEC master..xp_cmdshell @cmd
it gives me following error,
output
----------------------------------
> was unexpected at this time.
NULL
Will any body please help asap,
Thanks in advance,
Praveen