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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 avoiding cursors

Author  Topic 

viniit24
Starting Member

3 Posts

Posted - 2007-11-01 : 05:44:44
i have a table called Trustee with fields TrustNumber,ClientID and TrustName. here corresponding to a TrustNumber there could be more than one records. My requirement is to transfer all the rows corresponding to each distinct TrustNumber in a single row in a new table with fields say TrustNumber,ClientID1,TrustName2,ClientID2,TrustName2, ClientID3,TrustName3, and so on, maximum to 7. i had solved the problem using two cursors, but that is very time consuming( it took almost an hour to processed 58k records).
Can anyone suggest a better option for this.

thanks,
vineet

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-01 : 05:51:47
I just replied to your the other thread http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=91901


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -