May 14, 2008 at 9:51 pm
Hi how to Select from one sql database and insert into another database.
Source db as Sql Server 2000
Target db as Sql Server 2005.
I need to select one table data from Server 2000 & insert into Sql Server 2005
May 14, 2008 at 10:21 pm
Hi
In sql 2000 go to Master database add sp_addlinkedserver of sql 2005 & then follow the steps
Connect to sql 2000 , to the database & write the query
insert into xyz(a,b,c) select a,b,c from sql2005.sa.abc
where xyz is a blank table in sql 2000 , sql2005 is the name of the database in sql 2005 ,sa is the user who the right to the abc table & abc is the table
Regards
Sreenivas:)
May 14, 2008 at 10:53 pm
Thanks for ur reply..
Hi target db is in sql server 2005.
Where i have to add sp_addlinkedserver in 2005 or 2000?
Regards
May 14, 2008 at 10:54 pm
You can use the Import/Export wizard in SQL Server 2005, or - you can create an SSIS (Integration Services) package. If you use Import/Export wizard and save the package it will create an SSIS package for you that you can start with.
And finally, you can create a linked server.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
May 14, 2008 at 11:00 pm
The server that you are running the query on and inserting the data into - if it can see the other server or the source server.
On your 2005 server - create a linked server to the SQL 2000 server.
You can also use Management Studtio front-end under Server Objects --> Linked Servers
Thanks
Kevin
May 14, 2008 at 11:10 pm
Thanks Kevin..
I am running the query in SQL 2005 only..
May 14, 2008 at 11:13 pm
Have you linked the servers and are you able to return data from the SQL 2000 server?
May 15, 2008 at 4:52 am
Hi
Add sp_addlinkedserver in sql 2005
Regards
Sreenivas
May 15, 2008 at 5:10 am
Hi,
You can use openrowset statement without linking any server. If you are using this statement in 2005, you have configure 'Ad Hoc Distributed Queries' to 1.
May 15, 2008 at 8:03 am
Hi..
How to use this OPENQUERY without registering linked server?
September 3, 2009 at 9:20 am
Hi,
You have to register the linked server in order to use OPENQUERY. Here is a simple example for the use of OPENQUERY:
Select
X.FieldA,
X.FieldB,
X.FieldC
From
OPENQUERY([LinkedServerName],
'Select
FieldA,
FieldB,
FieldC
From
YourRemoteTable')
Bob Pinella
September 4, 2009 at 9:45 am
Why not create a DTS package if it is a one time job? Its very simple to transfer data (a table or more) from 2000 to 2005.
/Gosta
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy