Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Compare the structure & code of 2 databases

By G.R.Prithiviraj Kulasingham,

We often make changes in the test databases. But failure in making even the smallest change in the production database may lead to unwanted situations.

This utility compares 2 databases.
Parameters to be passed  
@DB1  Database 1 (SysName) 
@DB2  Databse 2 (SysName) 
@ShowDifferentOnly see later (Bit) 
    
Parameters 1, 2 may include server name as  well.
But the server should be either local or linked server.
This Procedure is devided into 2 parts 
Part I Checks the tables and Views (Column Definition, size, default) etc. 
Part II Checks the Code of Views, Stored Procedures and Triggers 
If @ShowDifferentOnly is set to 1 it will show only the lines that are different 
Otherwise all lines of both objects are shown. 
Default for @ShowDifferentOnly is 1 

Tested in SQLServer 2000 Service Pack 1. 

Known Issues:
If Server name or the database name is with space, it should be included with single Quote and not with braces ([]). This procedure is not checking for the braces in the name.

Note:
This procedure does not check the data. Only the structure is checked.

Total article views: 405 | Views in the last 30 days: 4
 
Related Articles
FORUM

checking database online or not

checking database online or not

FORUM

checking database online or not

checking database online or not

ARTICLE

Automating SQL Server Health Check (SQL Server 2005)

This article explain how to automate SQL Database server health checks, exactly what an ideal DBA de...

SCRIPT

Check Backups

Checking Backups on your SQL Server

FORUM

How to perform a Database Health Check?

How to perform a Database and\or sql server health check?

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones