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.
| Author |
Topic |
|
sheridan111
Starting Member
1 Post |
Posted - 2007-12-05 : 06:50:50
|
| I am trying to write a sql statement which will copy values from a view to a table.is there any way to create a trigger which fires on update, insert,to copy any new data only from the view to the tableThe view is called view_badge the table is called t_badgei tried to create a procedurecreate procedure update_view asinsert into t_badge select * from view_badge wheret_badge.stu_code != view_badge.stu_codethis query should only select values in view_badge which are not in t_badge but doesnt workany help is appreciated.Thanks, Iain.Iain M Campbell |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-05 : 06:53:01
|
[code]create procedure update_viewasSET NOCOUNT ONinsert t_badgeselect *from view_badgewhere not exists (select * from t_badge where t_badge.stu_code = view_badge.stu_code)[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2007-12-05 : 06:53:24
|
| what table is the view over?Em |
 |
|
|
|
|
|