how can copy 1 database table data to another database table
how can copy one database table data to another database table in porgramaticaly plz send idea or example
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Riddhi ValechaPosted Apr 9, 2015, 4:56 AM
Right-Click on table -> Script Table As -> Create To -> New Window
--
In the window, change database name/
Database - 1st Line
USE [DatabaseName]
Najim MullaPosted Apr 9, 2015, 4:35 AM
Ravi KumarPosted Apr 9, 2015, 4:27 AM
Najim MullaPosted Apr 9, 2015, 4:24 AM
Ravi KumarPosted Apr 9, 2015, 4:19 AM
example given below
create procedure procedurename
as
begin
insert into databasename2.dbo.secondtablename(columns1,column2)(select column1,column2 from databasename1.dbo.firsttablename)
end
Najim MullaPosted Apr 9, 2015, 4:18 AM
Ravi KumarPosted Apr 9, 2015, 4:16 AM
server also different or what
Najim MullaPosted Apr 9, 2015, 4:15 AM
Ravi KumarPosted Apr 9, 2015, 4:14 AM
both are in same database or different database.
server same or different
Najim MullaPosted Apr 9, 2015, 4:13 AM
Ravi KumarPosted Apr 9, 2015, 4:07 AM
use the store procedure
example given below
create procedure procedurename
as
begin
insert into secondtablename(columns1,column2)(select column1,column2 from firsttablename)
end