table rows transfer from one database to other database

Posted by Vinay_moduga under Sql Server on 11/1/2009 | Views : 1575 | Status : [Member] | Replies : 2
i want to copy data present in 3 to 4 tables which are in one database, to other database with same number of tables tell me the query very urgent




Responses

Posted by: Neeraaj.Sharma on: 6/28/2013 [Member] Starter | Points: 25

Up
0
Down
if (that particular database is directly accesed by your query window.)
{
then use insert into command

insert into database.schemaname.tablename
select * from tablename
}

Else
{

generate insert statement then then execute to the desired database where you want to insert the data for
that i made a store procedure visit

http://sql-server-script.blogspot.in/2012/10/sql-server-generate-insert-script.html

}



i hope this helps


visit my blog
www.tutorialsqlserver.com

Vinay_moduga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 11/2/2009 [Member] [Moderator] Silver

Up
0
Down
HI Vinay-

Use the Script available on this link.. http://lakhangarg.blogspot.com/2009/07/directly-create-sql-insert-statements.html

This will Create Insert Script of your Data by just passing the Name of the Table. and then you can use that insert statements to copy Data from One Db to another.

Thanks & Regards
Lakhan Pal Garg

Vinay_moduga, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response