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)
 To load values from one table to another table

Author  Topic 

Prajwal
Starting Member

6 Posts

Posted - 2005-07-03 : 15:27:59
I am trying to write a query/stored procedure to:

Insert all the values of all the fields of a table into another table having same no.of fields.In other words copying a table into another table.

Can anyone help me...

Thanks!!!

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-07-03 : 15:31:25
INSERT??????

Go to Start/All Programs/Microsoft SQL Server/Books Online
Go to the index tab and type in "insert".

It will give you several examples. You should be able to copy one of the examples and modify it slightly.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

Prajwal
Starting Member

6 Posts

Posted - 2005-07-03 : 18:41:22
Yes... to Insert... Can someone give me a query/stored procedure
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-07-03 : 21:20:38
Are you lazy??? Go to Books Online and copy/paste. We're here to help people, not do your work for you.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-04 : 01:59:19
In BOL index, type Insert from query
That will give example code

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Bredsox
Starting Member

4 Posts

Posted - 2005-07-05 : 15:03:16
For Lazy People like you,
select * into TableA
from TableB
OR
insert into TableA
select * from TableB
Go to Top of Page
   

- Advertisement -