What a want to do is something like that:
declare @id int
set @id = (select ID from tbUsers where Name = 'John_Stack')
declare @xml xml
set @xml = '<users> <user id = "' + @id + '"/></users>'
The server aborted saying
Operand type clash: int is incompatible with xml.
What is the best way to do this?
I'm working with SQL Server 2005.
Thanks in advance.