透過 Linked Server 比對兩個資料庫內的物件

簡單撰寫朋友的需求

select i.name,w.name,i.type,w.type, i.text ,w.text WebText from

(select o.name,i.colid, o.type,i.text from sys.syscomments i join sys.objects o on i.id=o.object_id) i

full join

(select o.name,i.colid, o.type,i.text from web02.rems.sys.syscomments i join web02.rems.sys.objects o on i.id=o.object_id) w

on i.name=w.name and i.colid=w.colid

where (i.name is null or w.name is null) or CHECKSUM(i.text)<>CHECKSUM(w.text)

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: