How to convert xml as a table or html table in sqlserver
问题 xml is a type in sqlserver, now I want to pass a table variable to procedure, but you must define the table as type (use "create type"). So I think I can use xml as a variable to pass into the procedure as parameters. declare @tv table ( id int, username varchar(50), department varchar(50) ) insert into @tv values(1,'tom','finance'),(2,'mark','business'); declare @xml xml; set @xml =(select * from @tv for xml path('row') ,type ) select @xml ; I want to use table like @tv as parameter, pass it