Mark Cohen is a CIO at Australia's largest online retailer and is a hands-on, sleeves-rolled-up, code-cutting geek. He lives in Sydney, Australia with his wife and boys and can sometimes be spotted puffing and panting as he runs at Maroubra Beach

Compare DBs

Here is a blazingly obvious yet useful SQL Query that will list objects by name in two databases to see what objects exist in one database but not in the other.

select name,type from otherdb.dbo.sysobjects
where
        type in (‘FN’,'P’,'TF’,'U’,'V’)
        and name not in (select name from sysobjects)
order by type

The ‘FN’,'P’,'TF’,'U’,'V’ makes it look at functions, stored procs, tables and views [figure it out... :) ].

No comments yet.

Write a comment: