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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-07-06 : 11:52:41
|
| Abra writes "Hi,I am trying to update tables in a linked server from sql server and I am getting one error that I just cant figure out. First I just look for changed fields in a record they both already have and then I just update those fields in the records. Here I just use the update function for the linked server and it works fine.Next I find any new inserted records so I transfer all the fields to the linked server and this is where the error comes in. I am using the Set Identity_Insert function and I just can't get it to work with a linked server. Now If I was importing data from the linked server to sql server then this function works fine, but since I am exporting data from sql server to the linked server it keep giving me errors. There is two errors that I just keep on getting: 1. The object name 'Object Name' contains more than the maximum number of prefixes the maximum is 2.The object name that I am using looks like 'LinkedServer...TableName' without the quotes. So when I get this error I changed the object name to look like 'LinkedServer..TableName' This time with only two dots becasue that I what I though the error was trying to tell me. But then I get another error which is: 2.Tabel 'Object Name' does not exist or cannot be opened for the set operation.I have tried many other things to figure these errors I just can't get it to work, so if you could help me out it would be really appreciated!!Thank you!" |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2004-07-06 : 13:16:38
|
| Are you linking to another SQL server? try using LinkedServer.dbo.TableName-ec |
 |
|
|
MuadDBA
628 Posts |
Posted - 2004-07-06 : 15:04:00
|
| actually, you have to specify the database on the linked server that you wish to connect to....otherwise how it is supposed to know if you want it to grab data from the MASTER database, the NORTHWIND database, or the PUBS database?It's always bet to spec out the full path at least once, as in:linkedserver.database.object_owner.objectafter that, I think you can alias it. |
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2004-07-06 : 15:17:18
|
quote: Originally posted by crazyjoe actually, you have to specify the database on the linked server that you wish to connect to....otherwise how it is supposed to know if you want it to grab data from the MASTER database, the NORTHWIND database, or the PUBS database?It's always bet to spec out the full path at least once, as in:linkedserver.database.object_owner.objectafter that, I think you can alias it.
good point. What the hell was I thinking?-ec |
 |
|
|
|
|
|
|
|