Monday, March 19, 2012

compare table related objects

Hi,
I am migrating a database from one server SQL 6.5 to another SQL 2000. I
want to have script to compare table related objects (index/PK/FK/constraint
)
for all the tables in the database to make sure nothing missing.
Anyone can help?Julia wrote:
> Hi,
> I am migrating a database from one server SQL 6.5 to another SQL
> 2000. I want to have script to compare table related objects
> (index/PK/FK/constraint) for all the tables in the database to make
> sure nothing missing.
> Anyone can help?
I'm not familiar with SQL 6.5, but in SQL 2000 there are the
INFORMATION_SCHEMA views that can be used to obtain a list of tables,
constraints, etc. You could use this to check that everything's there.
John.|||sql6.x does not have info_ views yet. You will have to look at sysobjects
for the list of objects. If you want to compare definition, you will have to
check out syscomments.
-oj
"Julia" <Julia@.discussions.microsoft.com> wrote in message
news:34ACC6D7-4157-4324-9960-2F099809C4A3@.microsoft.com...
> Hi,
> I am migrating a database from one server SQL 6.5 to another SQL 2000. I
> want to have script to compare table related objects
> (index/PK/FK/constraint)
> for all the tables in the database to make sure nothing missing.
> Anyone can help?
>
>|||I thought that might be the case.
In which case (assuming the migration is straight over and the objects will
either exist and be correct, or be missing), sysobjects with an appropriate
filter on the xtype column sounds ideal - BOL has full documentation on this
column (e.g. a value of U for user table, F for foreign key etc.)
John.
oj wrote:[vbcol=seagreen]
> sql6.x does not have info_ views yet. You will have to look at
> sysobjects for the list of objects. If you want to compare
> definition, you will have to check out syscomments.
>
> "Julia" <Julia@.discussions.microsoft.com> wrote in message
> news:34ACC6D7-4157-4324-9960-2F099809C4A3@.microsoft.com...

No comments:

Post a Comment