usually i will using temporary table to build dynamic query to compare the value for two indentical database between two servers but few weeks ago i know undocumented sp_msforeachtable stored procedure and gain some advantage for using it exec sp_MSforeachtable @command1 = ' IF EXISTS( SELECT top 1 * FROM [server2].db_name.? EXCEPT SELECT top 1 * FROM ? ) PRINT ''?'' ' just make sure u use "." in first syntax because sp_msforeachtable return "dbo.table_name" for parameters reference please see this link see u
this is my personal web blog..anything that i do each day hopefully can get in this blog since i only able to write it if i have spare time at the office..(ky g kerja aj ya hahaa)