473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

update sql errors using linked server

Hi,

I'm using sql server 2000 sp4.
I've 2 databases linked, an instance and my local.
I'm getting two different errors when trying to update the remote table
(local server) from the instance.
There is only one row of data in the table with an identity field.

1st sql:-
UPDATE [local].[database].dbo.NUMBERS SET [f 1]=3

This gives me the error:-
Server: Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '1'.

If I was to remove the space from [f 1] and use [f1] it would work
fine.

"select [f 1] from [dev001].[fashion Master].dbo.numbers"
will return the correct value

Any Ideas ?
2nd sql:-
UPDATE [local].[database].dbo.NUMBERS SET [field1]=isnull([field1],0)+1
This gives me the error:-
Server: Msg 7306, Level 16, State 2, Line 1
Could not open table '"fashion Master"."dbo"."NUMBERS"' from OLE DB
provider 'SQLOLEDB'. The provider could not support a row lookup
position. The provider indicates that conflicts occurred with other
properties or requirements.
[OLE/DB provider returned message: Multiple-step OLE DB operation
generated errors. Check each OLE DB status value, if available. No work
was done.]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IOpenRowset::OpenRowset
returned 0x80040e21: [PROPID=DBPROP_BOOKMARKS VALUE=True
STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_COMMANDTIMEOUT
VALUE=600 STATUS=DBPROPSTATUS_OK], [PROPID=Unknown PropertyID
VALUE=True STATUS=DBPROPSTATUS_OK], [PROPID=DBPROP_IRowsetLocate
VALUE=True STATUS=DBPROPSTATUS_CONFLICTING],
[PROPID=DBPROP_IRowsetChange VA...

If I was to remove the isnull part, then it will work ok

Any ideas

Jul 23 '05 #1
3 9087
(ma******@gmail.com) writes:
I'm using sql server 2000 sp4.
I've 2 databases linked, an instance and my local.
I'm getting two different errors when trying to update the remote table
(local server) from the instance.
There is only one row of data in the table with an identity field.

1st sql:-
UPDATE [local].[database].dbo.NUMBERS SET [f 1]=3

This gives me the error:-
Server: Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '1'.

If I was to remove the space from [f 1] and use [f1] it would work
fine.

"select [f 1] from [dev001].[fashion Master].dbo.numbers"
will return the correct value

Any Ideas ?
I've seen this before, and I'm quite sure that I have reported it to
Microsoft. However, it does not seem have been fixed in SQL 2000. The
error is that when the query is submitted to the remote server, the
brackets are missing.

I tried a similar query in SQL 2005, and it worked correctly.
2nd sql:-
UPDATE [local].[database].dbo.NUMBERS SET [field1]=isnull([field1],0)+1


I tried a similar query, but I could not reproduce the problem. Could
you post the CREATE TABLE statement for NUMBERS, including keys and
indexes?

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
md
2nd sql:- when adding the indentity field to my table I presumed an
index would be created. This was not the case, so I created this index
and now the sql works ok.
Thanks for the reply
Erland Sommarskog wrote:
(ma******@gmail.com) writes:
I'm using sql server 2000 sp4.
I've 2 databases linked, an instance and my local.
I'm getting two different errors when trying to update the remote table
(local server) from the instance.
There is only one row of data in the table with an identity field.

1st sql:-
UPDATE [local].[database].dbo.NUMBERS SET [f 1]=3

This gives me the error:-
Server: Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '1'.

If I was to remove the space from [f 1] and use [f1] it would work
fine.

"select [f 1] from [dev001].[fashion Master].dbo.numbers"
will return the correct value

Any Ideas ?


I've seen this before, and I'm quite sure that I have reported it to
Microsoft. However, it does not seem have been fixed in SQL 2000. The
error is that when the query is submitted to the remote server, the
brackets are missing.

I tried a similar query in SQL 2005, and it worked correctly.
2nd sql:-
UPDATE [local].[database].dbo.NUMBERS SET [field1]=isnull([field1],0)+1


I tried a similar query, but I could not reproduce the problem. Could
you post the CREATE TABLE statement for NUMBERS, including keys and
indexes?

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


Jul 23 '05 #3
md (ma******@gmail.com) writes:
2nd sql:- when adding the indentity field to my table I presumed an
index would be created. This was not the case, so I created this index
and now the sql works ok.


The only case indexes are created implicitly in SQL Server is when you
define a PRIMARY KEY or UNIQUE constraint. IDENTITY columns or FOREIGN
KEY columns do not come with an index, unless you actually create one.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dominic | last post by:
In our SQL database server, I set up a linked server . In this example, the linked server simply points back to the server. I did the following query at the SQL query analyser, and it worked...
9
by: David Berman | last post by:
I'm having a problem with an update operation in a stored procedure. It runs so slowly that it is unusable, unless I comment a part out in which case it is very fast. However, I need the whole...
0
by: bwalke | last post by:
I am trying to update data in a MS Access table with data from a SQL 2000 table connected by linked servers. Here are the update statements: This one Works\\ Update OpenQuery(MII, 'Select *...
3
by: lorirobn | last post by:
Hello, I am in the process of bringing my Access application to client's server, and need some help! The background is: I created application (mdb) using Access 2003 on my laptop, converted it to...
0
by: gshawn3 | last post by:
Hi, I am having a hard time creating a Trigger to update an Oracle database. I am using a SQL Server 2005 Express database on a Win XP Pro SP2 desktop, linked to an Oracle 10g database on a...
2
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
3
by: traceable1 | last post by:
I installed the SQL Server 2005 SP2 update 2 rollup on my 64-bit server and the performance has tanked! I installed rollup 3 on some of them, but that did not seem to help. I thought it...
1
by: itisjitin | last post by:
Hi All, 1. Created table in SQL Server 2K with Primary key as int Identity 2. Link to table in MS Access 2K with child table 3. Using form in MSAccess to update the both master and child linked...
3
by: Kunal Desale | last post by:
Hi, How to insert/update data in foxpro table field having datatype MEMO using Linked Server? I have written sql insert queries in which i have used linked server to insert data into foxpro...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.