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 2005 Forums
 Transact-SQL (2005)
 transfering entire data from 1 table to the other

Author  Topic 

WebCrab
Starting Member

8 Posts

Posted - 2009-11-02 : 03:10:56
hello, although i use sql server 2008 i hope it is the same to accomplish as in 2005.
if i understand correctly, i need the INSERT INTO command to transfer the data, i just don't know the correct syntax.
what i need should be as the following:
INSERT INTO DBname.2ndTableName
(
1stColumn,
2ndColumn,
Etc
)

VALUES
(
1stColumn,
2ndColumn,
Etc
)

FROM
DBname.1stTableName

10x.

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-11-02 : 03:15:33
INSERT INTO DBname.2ndTableName
(
1stColumn,
2ndColumn,
Etc
)
select
1stColumn,
2ndColumn,
Etc
FROM
DBname.1stTableName
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-02 : 04:10:29
DBname.2ndTableName


should be

DBname.ownername.2ndTableName


Madhivanan

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

WebCrab
Starting Member

8 Posts

Posted - 2009-11-02 : 05:48:30
bklr that was what i needed, and 10x to both of you.

Click! Click!
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-11-02 : 05:49:12
welcome
Go to Top of Page
   

- Advertisement -