x
login about faq Site discussion (meta-askssc)

Pivot in TSQL Vs SSIS

I have to perform an UNPIVOT operation on a table with 20 million rows. After the Pivot completes, I am going to do financial calculations, aggregations and write to another table which makes it a narrow but 70 million row result.

Where am I better off doing the UNPIVOT? My choices are

  1. TSQL (in the SELECT statement)
  2. Read the wide table into SSIS and do an UNPIVOT in SSIS.
more ▼

asked Sep 01 '11 at 01:05 PM in Default

Raj More gravatar image

Raj More
1.7k 74 78 82

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

There are so many factors to consider before making a recommendation, and the best person to do this is you! And, in the end, it's going to be a case of suck it and see. Some things for you to think about when making your decision:

  • can the box running the SSIS job cope with that size task?
  • Is there sufficient processing capacity on the SQL Server to handle it directly?
  • Where's the data going? Same server?
  • If the SSIS job is running on a separate box, how fast is the network between the two? You're going to have a lot of data flying around...
  • Is this a one-off job, or a regular task? If regular, which is going to be quicker / more consistent to run / allow for better error handling / scheduling? If one-off, which is going to be quicker / easier to develop and test?
more ▼

answered Sep 05 '11 at 03:04 AM

ThomasRushton gravatar image

ThomasRushton ♦
29.4k 6 9 36

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x749
x224

asked: Sep 01 '11 at 01:05 PM

Seen: 768 times

Last Updated: Sep 01 '11 at 01:05 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.