Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Combine multiple rows into single output Expand / Collapse
Author
Message
Posted Thursday, September 27, 2007 2:26 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 8:55 AM
Points: 148, Visits: 70
Comments posted to this topic are about the item Combine multiple rows into single output

Thanks
Mohit Nayyar
http://mohitnayyar.blogspot.com/
"If I am destined to fail, then I do have a purpose in my life, To fail my destiny"
Post #403725
Posted Thursday, November 08, 2007 5:32 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, March 28, 2014 11:01 AM
Points: 3,047, Visits: 1,229
Thanks Mohit. This sure saved me some time!


Post #420323
Posted Tuesday, February 05, 2008 9:48 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 06, 2008 9:10 PM
Points: 1, Visits: 2
Hi,
I am facing one performance issue.This is the scenario.

For eg., EmpId,EmpName,DeptId,DeptName,Sal are there.Except sal all the remaining columns values are same(I mean having same data).

Assume,here 4 rows are there in that table.

so I wrote a select query to get the data like 1,xx,1,yy,50,500,5000,1000

here 50,500,5000,1000... are the sal column values.

I wrote a function to get the sal values as comma separated ones if the remaining column values are same.But for Huge no' of records (assume for 25000 records), the performance is very bad.

So need a inbuilt query / any other solution for this problem.

Post #451998
Posted Tuesday, May 13, 2008 3:02 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, September 03, 2008 10:40 PM
Points: 286, Visits: 8
For same purpose we can use cussor too.
Can you specify which idea is better and why ?
Cursor Or UDF.
Post #499394
Posted Wednesday, May 25, 2011 8:53 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 1:23 PM
Points: 331, Visits: 1,238
Ran into the same issue here. This function causes my query to literally be 15 times slower. Going from under 1 second to over 15.

Haven't found a work around yet.
Post #1115163
Posted Wednesday, May 25, 2011 9:21 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 1:23 PM
Points: 331, Visits: 1,238
Actually I fixed this problem. I added an index on the table that I used in the function. This sped things right back up.

Have you tried adding some indexes?
Post #1115168
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse