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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 insert into linked server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-08 : 08:42:38
Roger writes "Is it possible to user OpenQuery or OpenRowset as the target of an insert into ... select ?,?,? from. The MSDN site mentions using it but I cannot find any examples and have not had any luck in tests I have performed.

I am running SQL 2000 on Windows 2000 server and an OLE DB for ODBC linked server.

Thanks"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-08 : 09:00:40
How about using the 4-part naming syntax for your linked server, something like:

INSERT INTO linkedServer.myDatabase.ownerName.myTable
SELECT * FROM someOtherTable


It should work like that. If not, let us know.

Go to Top of Page

philh
Starting Member

18 Posts

Posted - 2002-09-03 : 17:06:59
No dice. I'm using a linked server to a Pervasive SQL 2000 datasource (ugh). It won't accept any of the dot notation for the source.

Any other ideas?

tks,
PH
Go to Top of Page

rharmon
Starting Member

41 Posts

Posted - 2002-09-03 : 17:27:21
I'm afraid I don't have a pervasive machine here to play with, but this worked against my sql machine. Obviously you'll have to change the data source string to odbc, check books on like for further clarification.

insert into
OPENDATASOURCE(
'SQLOLEDB',
'Data Source=rharmon1ltp\rob;User ID=report_user;Password=report_user'
).Northwind.dbo.Categories (categoryname) values ('test')


Go to Top of Page
   

- Advertisement -