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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Querying

Author  Topic 

ynaina
Starting Member

9 Posts

Posted - 2010-09-27 : 07:32:30
I have table tbl_A and tbl_B with following data

seqno amt1 amt2 amt3 total
1 10 10 20 40
2 20 10 20 40
3 30 10 20 40

tbl_B
seqno calculation
4 1+2-3

Now i want to insert a row into tbl_A with seqno 4 and row1+row2-row3(1+2-3). tbl_A is temporary table which creates columns dynamically, so we don't have fixed number of colums in tbl_A.

Please help me.

Thanks in advance

kashyap.2000
Starting Member

22 Posts

Posted - 2010-09-27 : 07:54:33
quote:
Originally posted by ynaina

I have table tbl_A and tbl_B with following data

seqno amt1 amt2 amt3 total
1 10 10 20 40
2 20 10 20 40
3 30 10 20 40

tbl_B
seqno calculation
4 1+2-3

Now i want to insert a row into tbl_A with seqno 4 and row1+row2-row3(1+2-3). tbl_A is temporary table which creates columns dynamically, so we don't have fixed number of colums in tbl_A.

Please help me.

Thanks in advance



Do you want to insert only 2 column values into table A? if not what will be the valuees for amt1 amt2 amt3 ?

Failures will either break you or will make you a better perosn....
Go to Top of Page

ynaina
Starting Member

9 Posts

Posted - 2010-09-27 : 08:32:00
I want to insert seqno 4, amt1, amt2, ... total with its calculation


quote:
Originally posted by kashyap.2000

quote:
Originally posted by ynaina

I have table tbl_A and tbl_B with following data

seqno amt1 amt2 amt3 total
1 10 10 20 40
2 20 10 20 40
3 30 10 20 40

tbl_B
seqno calculation
4 1+2-3

Now i want to insert a row into tbl_A with seqno 4 and row1+row2-row3(1+2-3). tbl_A is temporary table which creates columns dynamically, so we don't have fixed number of colums in tbl_A.

Please help me.

Thanks in advance



Do you want to insert only 2 column values into table A? if not what will be the valuees for amt1 amt2 amt3 ?

Failures will either break you or will make you a better perosn....

Go to Top of Page
   

- Advertisement -