Comparing Database Schema in SQL Server and Sybase

A common development problem is to keep the schema of two databases in step.

This lists the tables:

    select tableName=name from sysobjects where type = ‘U’ order by name

This lists the fields per table:

    select tableName =,
       colName =,
       colLength = sc.length,
       colOrder = sc.colid,
       dataType = 
  from sysobjects so
 inner join syscolumns sc on =
 inner join systypes st on st.usertype = sc.usertype
 where so.type = ‘U’
 order by, sc.colid
Between the two you have the tools needed to compare two database schemas.
The only restriction is the database access.

This does not compare contents – that is a different problem.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

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

Connecting to %s