Database Schema

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jack

    Database Schema

    Hi

    In my project there's a frequent change in database schema of
    production and testing due to the weekly production.

    so this talks lot of effort to figure out which is the exact table
    which we have made the change

    so for the purpose i thought of making an small application which will
    list me the tables or columns which are not in sync.


    I tried some of the stuff but was not successful in it

    i was able to get the database tables but executing the below query.

    Select * from sysobjects
    where xtype='u

    But when i tried to get the column schema to compare it with the table
    from another database table, i was unable to do so.

    below is my unsuccessful query string which i executed in the
    SQLCommand object


    Select * from sys.all_columns where object_id= object_id('Tabl eName')


    Please help


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Database Schema

    jack,

    Not that I would disuade you from trying to do it yourself, but have you
    looked at any tools to do this? There are some very good tools on the
    market that can determine changes in schema, and it would probably save you
    a lot of time coding this yourself.

    I like the tools from Red Gate in particular (this is the link to SQL
    Compare):



    Apex also makes a tool to do this:

    SQL DevOps tools required to drive an automated DevOps workflow


    And another one I found on Google:

    SQL compare and synchronization software. Quickly and accurately compare and synchronize your databases!



    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "jack" <gautams.mail@g mail.comwrote in message
    news:c43d225a-4222-4a56-a64e-af34eb558dec@t1 6g2000hsc.googl egroups.com...
    Hi
    >
    In my project there's a frequent change in database schema of
    production and testing due to the weekly production.
    >
    so this talks lot of effort to figure out which is the exact table
    which we have made the change
    >
    so for the purpose i thought of making an small application which will
    list me the tables or columns which are not in sync.
    >
    >
    I tried some of the stuff but was not successful in it
    >
    i was able to get the database tables but executing the below query.
    >
    Select * from sysobjects
    where xtype='u
    >
    But when i tried to get the column schema to compare it with the table
    from another database table, i was unable to do so.
    >
    below is my unsuccessful query string which i executed in the
    SQLCommand object
    >
    >
    Select * from sys.all_columns where object_id= object_id('Tabl eName')
    >
    >
    Please help
    >
    >

    Comment

    • jack

      #3
      Re: Database Schema

      Thanks for replying me.


      have surfed on net and found some of the interesting tools like
      tablediff.exe which is the standard tool of sql and can be used with
      the command prompt arguments

      but still not very straight forward way of getting all the table
      difference in one shot.


      Comment

      Working...