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
 how to update new table ?

Author  Topic 

samsun125
Yak Posting Veteran

63 Posts

Posted - 2009-01-22 : 02:07:29
Hi all,

i selected few columns from one table and stored into new table, so

problem is if i add or modified old table i want to update in new

table also , how to do.

Please give me idea.

Thanks & Regards
Rama

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-22 : 02:20:22
use triggers or stored procedure for that
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-22 : 09:03:50
an insert,update trigger on main table should be ok. something like

CREATE TRIGGER testtrig
ON Table1
AFTER INSERT,UPDATE
AS
BEGIN
INSERT INTO table2 (columns....)
SELECT columns...
FROM INSERTED
END
Go to Top of Page
   

- Advertisement -