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

avatar image

Raj More
1.8k 83 89 90

(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

avatar image

ThomasRushton ♦♦
42.4k 20 60 54

(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



Answers and Comments

SQL Server Central

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



asked: Sep 01, 2011 at 01:05 PM

Seen: 1528 times

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

Copyright 2018 Redgate Software. Privacy Policy