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
 Development Tools
 Other Development Tools
 Update Temporary table

Author  Topic 

harsh.b.snehy
Starting Member

1 Post

Posted - 2008-01-11 : 04:33:19
[b]In INFORMIX....i have created a tempory table from an existing table. Now we are putting this temp table into mapping and want this table to be updated whenever there is a change in the original table.How do we do this.Trigger may be used but how ???
Please give the solution.[/
b]

harsh

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-01-11 : 05:17:29
moved from article discussion

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

Msandlana
Starting Member

33 Posts

Posted - 2008-01-11 : 06:11:18
Can you try this I'm not sure if its gonna work


create trigger [trigger_name]
on [dbo].[table_name]
after update
as
if exists (select * from inserted)
begin
update h
set h.column_name = f.column_name
from table_name h
inner join table_name f
on f.column_name = h.column_name
inner join inserted i
on f.column_name = i.column_name
end
Go to Top of Page
   

- Advertisement -