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)
 getting problem while inserting using linked serve

Author  Topic 

hafeez
Starting Member

14 Posts

Posted - 2006-09-26 : 05:58:02
Hi ,
My requirement is to read and write the data from remote SQL SERVER.
Locally i have SQL SERVER and i want read and write the data from remote SQL SERVER.

I am able to read the data from remote SQL SERVER but i am getting the following error while inserting.

I created one linked server in my machine and mentioned the remote server name as data source.

The query is :

INSERT INTO OPENQUERY(DPVNEWLINK1, 'SELECT * from hyi3w131.SQLDPV.dbo.SAMPLEHAF') values(11,12);

The error is:
Msg 7356, Level 16, State 1, Line 1
The OLE DB provider "SQLNCLI" for linked server "DPVNEWLINK1" supplied inconsistent metadata for a column. The column "ROWID" (compile-time ordinal 1) of object "SELECT * from hyi3w131.SQLDPV.dbo.SAMPLEHAF" was reported to have a "Incomplete schema-error logic." of 0 at compile time and 0 at run time.


Please suggest me regarding this.
Thanks in Advance,
Hafeez.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-26 : 06:03:15
Try to rewrite the "SELECT *" thingy to only retrieve the two columns inserted.
Also name the two columns inserted as

INSERT INTO OPENQUERY(DPVNEWLINK1, 'SELECT col1, col2 from hyi3w131.SQLDPV.dbo.SAMPLEHAF')
(col1, col2) values(11,12);


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

hafeez
Starting Member

14 Posts

Posted - 2006-09-26 : 06:14:22
Thanks for your reply.I tried whatever you mentioned above. But still getting the same error.
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-09-26 : 08:06:44
Can you try this??

Insert Into DPVNEWLINK1.SQLDPV.dbo.SAMPLEHAF
Select 11,12

??

Chirag
Go to Top of Page

hafeez
Starting Member

14 Posts

Posted - 2006-09-27 : 05:13:00
Hi All,
Thanks for your response. I am able to insert the data. That is something wrong with my system. I am able to run same query from other machine.
Thanks a lot
Hafeez.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-27 : 07:01:23
Check your user privileges and security rights.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -