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
 Transact-SQL (2000)
 Linked server Query

Author  Topic 

ramdas
Posting Yak Master

181 Posts

Posted - 2004-12-27 : 09:05:32
Hi folks,
I have a linked server set up on Server_a to point to Server_b.
I can run select queries from server_a on tables in Server_b.
For example: SELECT * FROM server_b.userdb.dbo.table_a. This works Fine.
When I do a Update statement like:

UPDATE server_b.userdb.dbo.table_a
SET col1='test'
where col2='test'
in the query analyzer on server_a , i get an 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 'Col1'.

What could be the reason this is happening.

Ramdas

Ramdas Narayanan
SQL Server DBA

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-27 : 10:51:27
How are you setting up the linked server? Is the remote sql server?
http://www.mindsdoor.net/SQLAdmin/Addlinkedserver.html


update self.test.dbo.test set t='asd' where s='abc'
works fine.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -