SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Populating data from one table to another
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kant
Starting Member

6 Posts

Posted - 08/17/2001 :  14:59:21  Show Profile  Reply with Quote

How can I populate the data in to a new table from a existing table?

AjarnMark
SQL Slashing Gunting Master

USA
3246 Posts

Posted - 08/17/2001 :  15:00:37  Show Profile  Visit AjarnMark's Homepage  Reply with Quote
Use SELECT...INTO... Check BOL for more details.


------------------------------------------------------------------
Contractor$ never die, they just leave for higher-paying project$.
Go to Top of Page

kant
Starting Member

6 Posts

Posted - 08/17/2001 :  15:04:19  Show Profile  Reply with Quote
quote:

Use SELECT...INTO... Check BOL for more details.

what is BOL?

------------------------------------------------------------------
Contractor$ never die, they just leave for higher-paying project$.



Go to Top of Page

dadunn
Yak Posting Veteran

67 Posts

Posted - 08/17/2001 :  15:07:52  Show Profile  Reply with Quote
BOL is Books On Line. It is the reference that comes on the SQL Server CD. When you install the server or client components, it gives you the option to install it.

It is a surprisingly complete reference for SQL Server and it is well worth your time to install it and become familiar with it.


>>>>>>>>>>>>>>>>>>>>>>>
Just sittin' around waiting for the servers to crash.

Dave
Go to Top of Page

mj
Starting Member

USA
25 Posts

Posted - 08/17/2001 :  15:08:36  Show Profile  Reply with Quote
Sql server Books OnLine.

It should come as part of the standard install of SQL Server.

mj

Go to Top of Page

kant
Starting Member

6 Posts

Posted - 08/17/2001 :  15:17:36  Show Profile  Reply with Quote
actually it is just one field that needs to be populated. can you please be more specific? Table A has field 1
from which the data needs to be populated to
Table B which has field 2



Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

USA
3246 Posts

Posted - 08/17/2001 :  15:28:19  Show Profile  Visit AjarnMark's Homepage  Reply with Quote
If the tables already exist, then use INSERT...SELECT so it would look something like

INSERT INTO TableB (col2)
SELECT col1 FROM TableA

If you want to create a new table then something like

SELECT col1 FROM TableA INTO TableB

And REALLY, start exploring Books On Line, it is VERY handy.

------------------------------------------------------------------
Contractor$ never die, they just leave for higher-paying project$.
Go to Top of Page

kant
Starting Member

6 Posts

Posted - 08/17/2001 :  19:31:20  Show Profile  Reply with Quote


thank you for the help..


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000