October 6, 2009 at 3:24 am
Hi Experts,
I want to copy and the tables from one server to another i tried to create a procedure in which i wil give the table name so that particular table weil be copied
create proc copytbl
declare tblname varchar(100)
as
select * into @tblname openquery ([DB2-21], 'select * from chema_name.@tblname')
Is there any other way to achive the same.
PLEASE HELP ME IN WRITING THIS PROCEDURE
TIA
October 7, 2009 at 1:09 am
Consider using SSIS or the "import and export wizard".
See also http://msdn.microsoft.com/en-us/library/ms175937(SQL.90).aspx and http://msdn.microsoft.com/en-us/library/ms190923(SQL.90).aspx.
October 7, 2009 at 7:03 pm
Why not just restore a backup?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 9, 2009 at 1:20 am
This should work
select * into x from [Linked Server Name].[Database Name].dbo.TableName
Caution: The above statement will just create x table with data copied from TableName and will not copy the keys, contraints and index from TableName
October 12, 2009 at 3:21 am
Why not SSIS
"Keep Trying"
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply