January 16, 2009 at 11:01 am
From reading BOL on the FROM statement it says that it should be
linked_server.catalog.schema.object
However, I can't get this to work (I'm running from server named Rabbit)
select name, type from sys.procedures
where name not in (select name FIVER.AHOG.dbo.sys.procedures)
order by name
I want to compare to the list of procedures on
Server: FIVER
DB:AHOG
It gives an error: Incorrect syntax near '.'
What am I missing?
January 16, 2009 at 11:05 am
The naming convention of SQL Server is a four part name.
Try this naming convention
You should not have DBO in that name
-Roy
January 16, 2009 at 11:06 am
select name, type from sys.procedures
where name not in (select name from FIVER.AHOG.dbo.sys.procedures)
order by name
'from' is missing in the sub-query in WHERE clause..
January 16, 2009 at 11:12 am
two things i think, but i could't get mine to work yet either.
4 part naming conventions are the limit.
select name FIVER.AHOG.dbo.sys.procedures is wrong
its probably FIVER.AHOG.sys.procedures not what you had....i tried something similar on mine and could not get to it. I was able to get to select * from FIVER.AHOG.dbo.sysobjects, just not to the sys.* views.
maybe you can just change that piece?
Lowell
January 16, 2009 at 11:23 am
Yeah I did forget the from.
select name, type from sys.procedures
where name not in (select name FROM FIVER.AHOG.sys.procedures)
order by name
How do I link the servers so I can use the NTLogin for both in this type of action?
January 16, 2009 at 11:23 am
Instead of sys.objects, why not try
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
-Roy
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply