Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Populate Table Question

Author  Topic 

Bobba Buoy
Starting Member

36 Posts

Posted - 2004-06-24 : 06:24:08
I want to create a table in a sql server db that is linked via FK to an existing table. The existing table has about 2000 records in it. I want to add a corresponding record in my new table for each record in the existing table. Is there a way to do that in Enterprise Manager?

Thanks!

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-06-24 : 06:28:12
[code]
insert into newTable (FKColumn)
select PKColumn from oldTable
[/code]

Then create the constraint...
Go to Top of Page

Bobba Buoy
Starting Member

36 Posts

Posted - 2004-06-24 : 06:55:59
Thanks. I apologize but I have not worked in enterprise manager much. Where do I write this code and are those two seperate sql statements?

Thanks for your patience!
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-06-24 : 07:00:19
No, it's one statement, write it in Query Analyser...
Go to Top of Page
   

- Advertisement -