Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
komnaz
Starting Member
5 Posts |
Posted - 2009-12-20 : 08:26:51
|
| declare @empid varchar(10)declare @yr varchar(10)select @empid=EmpId, @yr=Yr from sales where Yr='2005' select @empid,@yr --for xml autoI want to generate @empid and @yr in XML formate |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-12-22 : 01:11:13
|
| Try like thisdeclare @XML xmlset @XML = (select Emp_id, year from mytable for XML Auto, root('tables'), Elements) print cast(@XML as varchar(max))Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
|
|
|