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 |
raxbat
Yak Posting Veteran
52 Posts |
Posted - 2007-12-11 : 01:05:54
|
Hello All!I have a view which returns some data! And I have a table with the same structure as a view! How do I insert(or update if row already present) view results into the table?Thank You |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-11 : 01:57:25
|
Insert new dataInsert into table(columns) select columns from view vwhere not exists(select * from table where keycol=v.keycol)Update existing dataUpdate tset col1=v.col1,...from table t inner join view v on t.keycol=v.keycolMadhivananFailing to plan is Planning to fail |
 |
|
raxbat
Yak Posting Veteran
52 Posts |
Posted - 2007-12-11 : 01:58:05
|
Thanx a lot :) |
 |
|
|
|
|