o alta posibila abordare este si :
create table ##A (a nvarchar(256))
insert into ##a(a)
select 'ceva Id="' + name + '"/' --nu uita sa dechizi si sa inchizi tag-ul, nu ma descurc cu editorul html :)
from sys.columns
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
declare @str varchar(255)
select @str = 'osql -Q"select a from ##a" -E -oc:\file.txt'
exec master..xp_cmdshell @str
dar mai trebuie lucrat la osql (are optiune pentru scos capul de tabel, definit output etc.)
Cătălin D.