
- Forum
- Databases
- SQL Server - create a table with 3 column where sum of 2 column is 3rd column
-
Junior Member
create a table with 3 column where sum of 2 column is 3rd column
create a table with 3 column where sum of 2 column is 3rd column
ex
col1 col2 col3
1 2 3
3 4 7
2 2 4
-
Junior Member
Re: create a table with 3 column where sum of 2 column is 3rd column
select col1,col2,col1+col2 from table
-
Junior Member
Re: create a table with 3 column where sum of 2 column is 3rd column
I need while creating the table, it have to effect the data base table
-
Contributing Member
Re: create a table with 3 column where sum of 2 column is 3rd column
I think you can create a trigger on this table which will update the value of third column if there is any insert/update on that table.
That's the only way I think is to fulfill your requirement.
---V V---
Vikas Vaidya
-
Junior Member
Re: create a table with 3 column where sum of 2 column is 3rd column
now i got the answer
this is the answer
CREATE TABLE sample6
(
col1 int ,
col2 int,
col3 as(col1 + col2)
)
-
Sponsored Ads
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules