我想做类似的事情
use mydb
go
begin tran
merge dbo.aTestTarget as T
using dbo.aTestSource as S
on (T.link = S.link)
when not matched by target and (s.code like '*I%') then
-- is there a way to do this sort of thing?
insert (T.*) values (S.*)
when matched and ...
rollback tran
go
有没有办法在不定义每一列的情况下做到这一点?我有许多包含 20 到 50 个字段的表。