December 30, 2009 at 12:24 am
Dear Friends,
I have created my own DB which included a table named "Tables_Information". In this table i have created 8 columns which includes, Seq No, Module Name, Table Name, Table Desciption, Table Fields, Fields type, primary key as boolean, Foreign key as boolean.
I want to copy all these information from SQL 2000 DB to my local table fields. Any method / procedure to fulfill this requirement???
Regards,
Raza Usmani
Software Engineer
December 30, 2009 at 9:11 am
Is your local database that includes the new table in SQL 2005 or SQL 2000? Since you posted in the Integration Services forum, I could assume that it's in SQL 2005 and recommend that you use the Import Wizard in Management Studio.
Greg
December 31, 2009 at 3:50 am
Both Databases are on the same Server which is SQL 2000. Somehow i have managed to collect almost all data but unable to get foreign keys information.
Regards,
Raza
December 31, 2009 at 4:47 pm
You can find that in the sysforeignkeys system table. Here's a query that will list foreign key info for the tables in a database:
select t.name as 'Table', c.name as 'Foreign_Key_Constraint', rt.name as 'Referenced_Table'
from (select distinct constid, fkeyid, rkeyid from sysforeignkeys) as FK
join sysobjects c on c.id = FK.constid
join sysobjects t on t.id = FK.fkeyid
join sysobjects rt on rt.id = FK.rkeyid
order by 1,2,3
Greg
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy