p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   merging feilds? (http://p2p.wrox.com/showthread.php?t=47419)

dazednconfused September 5th, 2006 10:52 AM

merging feilds?

I am trying to move two fields that will be stored in different records into on field in another table, but I am unsure how to do it. To explain I have two tables one called codes and the other called event

eg codes table may look like this
codeguid |desc1
{1B8113D9-4A19-4F95-8E4D-029F55D65A0D}| testa
{1B8113D9-4A19-4F95-8E4D-029F55D65A0D}| testb

and I want to move the desc1 values into the table called event where the codeguid is matched
eventguid |merged_descriptions
{1B8113D9-4A19-4F95-8E4D-029F55D65A0D}| testa, testb

I hope that makes sense?
I was hoping to do it without having to use an ineficient cursor as there are many records in the table. Is it possible to to run an update query that will return possibly more than 1 value from the codes table and put them into one field on the event table where a match is found on codeguid and eventguid?

Any help would be appreciated. I can try to explain this better if it would help


P.S. I forgot to mention that this is how the event table stands at the monent

eventguid |merged_descriptions
{1B8113D9-4A19-4F95-8E4D-029F55D65A0D}| NULL

So it is an update I am trying to do

dazednconfused September 7th, 2006 05:38 AM

It always bugs when I find a post on a forum by someone that has had the same problem as me and there is no answer and you dont know if there was a solution or not. so I am just writing here to say that I ended up using a cursor despite its inefficiency.

All times are GMT -4. The time now is 01:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.