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 |
Zul
Starting Member
17 Posts |
Posted - 2009-06-25 : 07:29:01
|
hi alli want to ask again.how can i insert data from db master to db client if in db master there have duplicate data?can we use no exists?can you show me the query??RegradsZul |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-25 : 08:20:10
|
INSERT TargetTable (Co1, Col2, ... )SELECT DISTINCT s.Col1, s.Col2, ...FROM SourceTable AS sWHERE NOT EXISTS (SELECT * FROM TargetTable AS t WHERE t.pkCol = s.pkCol) E 12°55'05.63"N 56°04'39.26" |
|
|
|
|
|