referencing remote SQL Server instance
Posted on 2006-06-28
I have this query I want to run against my local server and another server. I have done all the sp_addlogin crap. Normally it is easy, I just do servername.databasename.owner.table, but with this particular update, I have a problem
update [dataserver].xyz_rbg.dbo.masterorg set dst_identifier = null
where dst_identifier is not null and
not exists (select * from distrib where distrib.dst_identifier = dataserver.xyz_rbg.dbo.masterorg.dst_identifier)
but I get the error "The number name 'dataserver.xyz_rbg.dbo.masterorg' contains more than the maximum number of prefixes. The maximum is 3." I cannot alias the table in an UPDATE as I would in a SELECT.
I've run into this before, and I usually just hack a way (do it from the other end, rename the column so I don't need to prefix it, copy data around, etc.), but I'm getting sick of it. Am I doing something wrong?