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 |
|
lesoft
Starting Member
1 Post |
Posted - 2006-04-05 : 18:42:08
|
| Hi,I have two tables (mater_table and temp_table) with identical structure but they have different values. How do I write a store procedure to return a result with the following1) showing new records2) show updated recordsFor now, the table has only one varchar column "name".Thanks in advance for your help!Tuan |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-04-05 : 19:07:10
|
| You can't show updated rows if there is only one column - how do you know it's updated rather than deleted and a new row?For new rowsselect tmp.*from tmpleft join masteron master.name = tmp.nameand master.name is null==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-05 : 19:19:18
|
"I have two tables (mater_table and temp_table) with identical structure but they have different values"What is the relationship between these 2 tables ? What is the temp_table for ?"1) showing new records"What do you mean by new records ? Records exist in temp_table but not in master_table ?2) show updated recordsWhat do you mean by updated records ?What are you trying to achieve here ? KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|