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 |
|
Tim F
Starting Member
35 Posts |
Posted - 2005-04-04 : 11:12:20
|
Hi All,I've got a table here (sims.sims_member) with person_id in it. I need to loop through it and pass the xml to the stored proc.How do I get this text into the local variable @personids ??-----------------------------------------------------------------declare @personids varchar(5000) -- This is an example call exec sims.att_pix_sync_student_marks_ATW625 @personids = '<data> <row person_id="1" /> <row personid="2" /></data> 'Thanks, Tim  |
|
|
Tim F
Starting Member
35 Posts |
Posted - 2005-04-05 : 03:38:34
|
| Does no-one know this?? |
 |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2005-04-05 : 04:32:18
|
You could try something like thisUSE NorthwindGODECLARE @personids varchar(5000)SELECT @personids = COALESCE(@personids + '"/>', '') + '<row person_id="' + CONVERT(varchar(5),EmployeeID) FROM Employees ORDER BY EmployeeIDSET @personids = '<data>' + @personids + '"/></data>'PRINT @personids AndyBeauty is in the eyes of the beerholder |
 |
|
|
Tim F
Starting Member
35 Posts |
Posted - 2005-04-05 : 05:02:46
|
| Thanks fella, that's v. helpful. |
 |
|
|
|
|
|