Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Copying Tables structure from SQL 2000 to Local database. Expand / Collapse
Author
Message
Posted Wednesday, December 30, 2009 12:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 6, 2013 2:30 AM
Points: 2, Visits: 3
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
Post #840203
Posted Wednesday, December 30, 2009 9:11 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 9:16 AM
Points: 4,064, Visits: 5,340
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
Post #840403
Posted Thursday, December 31, 2009 3:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 6, 2013 2:30 AM
Points: 2, Visits: 3
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
Post #840753
Posted Thursday, December 31, 2009 4:47 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 9:16 AM
Points: 4,064, Visits: 5,340
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
Post #840999
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse