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.
Author |
Topic |
natew010
Starting Member
1 Post |
Posted - 2011-09-20 : 09:04:22
|
Hey guys, I was hoping you all could help me out with this. So I have a table in my database with columns and a value for each of those columns tied to a specific partnumber. The other table also contains the partnumber and two other columns named "attribute name" and "value". What I need to do is take those columns (width, thickness, etc) and their values from table A, and turn them into rows in the other table (now the column name from table A will be the value under "attribute name" and the value from table A will be in the column "value". Here is an example of what table B currently looks like:PartNumber AttributeName ValueT573 Metal Type 5T573 Product Line 3T573 Styling 7R422 Metal Type 9R422 Product Line 2R422 Styling 1So after the package runs, it should look like:PartNumber AttributeName ValueT573 Metal Type 5T573 Product Line 3T573 Styling 7T573 Width 2.14T573 Thickness 3etc...I need to do this for each unique partnumber.Can you guys help me with the SQL statement to do this and the SSIS job?Thanks a lot!! |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-20 : 11:18:04
|
why do you need ssis for this? isnt it matter of sql script likeINSERT INTO DestinationTableSELECT PartNumber,AttributeName,AttributeValueFROM SourceTableUNPIVOT (AttributeValue FOR AttributeName IN ([width],[thickness],...))u ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|