Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2006, 10:52 AM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default merging feilds?

Hi,

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

Thanks

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
 
Old September 7th, 2006, 05:38 AM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging nodes trishla XSLT 11 October 18th, 2007 03:01 PM
Grouping/Merging Jens Rudolph XSLT 2 June 6th, 2007 02:50 AM
Merging files ajindal General .NET 2 January 10th, 2007 06:42 AM
Merging Tables Charlotte89 Access 5 November 22nd, 2006 12:49 AM
Merging reports siptah Access VBA 1 May 13th, 2005 08:05 AM





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