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
 dynamic tabel value

Author  Topic 

sqlmasterpro
Starting Member

1 Post

Posted - 2011-01-08 : 12:01:24
hi
i never programmed with sql and i decided to try it out
my question is
can i set a table column to have a dynamic field
like tabel1.TOTAL = tabel2.AMMOUNT + tabel3.AMMOUNT

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-08 : 12:19:25
Not as a calculated column, no, but you can issue an update statement to populate the column with whatever you choose.

Update table1
SET TOTAL = table2.amount + table3.amount
From table1 inner join table2 on table1.ID = table2.ID
inner join tbale3 on table1.ID = table3.ID

Or something like that. Without more detailed info about your needs..



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page
   

- Advertisement -