x

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, 2011 at 01:05 PM in Default

Raj More gravatar image

Raj More
1.7k 79 82 84

(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, 2011 at 03:04 AM

ThomasRushton gravatar image

ThomasRushton ♦
33.8k 18 20 44

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x928
x279

asked: Sep 01, 2011 at 01:05 PM

Seen: 1260 times

Last Updated: Sep 01, 2011 at 01:05 PM