Compare contents of two tables.

SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CompareTables]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp_CompareTables]GOCREATE PROCEDURE sp_CompareTables @table1 sysname, @table2 sysname, @ColumnList varchar(8000) = '*', @Summary bit = 0, @Detail bit = 1, @TableNameHeader varchar(30) = '[Table Name]', @CounterHeader varchar(30) = '[Counter]', @rc int = null... Continue Reading →

Compare 2 database tables

SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ON GOIF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CompareDBTables]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp_CompareDBTables]GOCREATE PROC sp_CompareDBTables@targetDB sysname,@Summary bit = 0,@Detail bit = 1--****************************************--@targetDB: we'll compare the current database with this one--@Summary: do we want summary output?--@Detail: do we want detail output?--calls sp_CompareTables for each table in... Continue Reading →

A Website.

Up ↑