x

[Closed] Store Procedure

hi i have a table

 Name var value1 value2
 Abc aa 123 10
 Bcd bb 32 21
 Fgr cc 12 34
 Etc …..

I need to (create new/update) following result table.

For every aa I should have three entries ie aa, ab and ac. Similarly for every bb I should have 2 entries like bb and ba and cc should have four entries like cc,ca,cb and cd and so on. And these extra entries will remain constant like for aa resulting table will have 3, for bb it will have 2 and for cc it will be 4 etc Rest of the values in table will not change so my resulting table becomes

 Name var value1 value2
 Abc aa 123 10
 Abc ab 123 10
 Abc ac 123 10
 Bcd bb 32 21
 Bcd ba 32 21
 Fgr cc 12 34
 Fgr ca 12 34
 Fgr cb 12 34
 Fgr cd 12 34

I would be really appreciate if some one could tell me about how should i approach this ... thank you in advance ....

more ▼

asked Sep 24, 2012 at 07:01 PM in Default

avatar image

abhi2702
48 3 3 6

You should ask the question in the question area, not in the side discussion.

Sep 27, 2012 at 11:55 AM DirkHondong

moved :)

Oct 10, 2012 at 08:22 AM Kev Riley ♦♦
(comments are locked)
10|1200 characters needed characters left

The question has been closed Oct 10, 2012 at 02:04 PM by ThomasRushton for the following reason:

Duplicate Question - http://ask.sqlservercentral.com/questions/93710/store-procedure-1.html


1 answer: sort voted first
more ▼

answered Oct 10, 2012 at 01:37 PM

avatar image

mjharper
2.2k 3 8 14

OK, I've closed this as it is a duplicate

Oct 10, 2012 at 02:04 PM ThomasRushton ♦♦
(comments are locked)
10|1200 characters needed characters left

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:

x476
x438

asked: Sep 24, 2012 at 07:01 PM

Seen: 713 times

Last Updated: Oct 10, 2012 at 02:04 PM

Copyright 2017 Redgate Software. Privacy Policy