Hi All,
Right now ,I have to somthing really wierd in MS SQl SERVER 2008.
Explaining the scenario - "I have a table ABC with 5 columns (Column1,Column2.....Column5).I have one another table XYZ with three columns(Column11,Column12,Column13)".
What i need to do is "I have 3 columns namely Column3 ,column4,column5 of tbale ABC recieving multiple values under the same row like A:B:C for column3 ,A1:B1:C1 for Column4 and A2;B2:C2 for column5. I have to get these values inserted into the XYZ in such a way that Column3 maps Column11,Coulmn4 maps Column12 and Column5 maps Column13 of table XYZ.
Table ABC
Column1 Column2 Column3 Column4 Column5
xxxx xxxx A:B:C A1:B1:C1 A2;B2:C2
to
Table XYZ
Column11 Column12 Column13
A A1 A2
B B1 B2
C C1 C3
Now the real thing lies in this,the insertion to the table is made in such a way that A row in ABC with above values should create 3 rows with values A1,A2,A3 ; B1,B2,B3 and C1,C2,C3 respectively for Columns 11 Column12 and Column13 respectively i.e mean separate row for each value in XYZ table"
Can anybody please help me out to handle this thing either through temp table or view or something else.
P.S : try to avoid Cursor an same should happen for around 10 rows in ABC having different combination of values
Thanks
Utkarsh