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
 General SQL Server Forums
 New to SQL Server Programming
 insert data from 1 database table to another dbase

Author  Topic 

yaman
Posting Yak Master

213 Posts

Posted - 2008-04-04 : 08:03:59
how to insert data from 1 database table to another database tables


pls help me out
i m very much thank ful to u

Yaman

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-04 : 08:05:25
If both databases on same server:

Insert into db1.dbo.table1(col1, col2..)
select col1, col2,... from db2.dbo.table1


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

yaman
Posting Yak Master

213 Posts

Posted - 2008-04-04 : 08:18:50
Thank u very much sir for help me out .

i got one another solution
select * into dbase1.dbo.table2 from dbase2.dbo.table2

I have one another quetion if SERVER is not same
then .......

Yaman
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-04 : 08:20:49
In that case, you need to add the server in question as Linked Server.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-05 : 02:54:21
or look at openrowset in sql server help file

Madhivanan

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

vinod.supekar
Starting Member

1 Post

Posted - 2010-06-02 : 06:01:45
too good

Regards,
vinod supekar
Go to Top of Page
   

- Advertisement -