I have a stored procedure I am writing. It will exist on one server and analyze database information for other linked servers. I have one peice of it that looks like this:USE [master]GO/****** Object: StoredProcedure [dbo].[GetDatabaseInfo] Script Date: 07/30/2009 07:49:30 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOAlter PROC [dbo].[GetOfflineDBInfo]@Servername sysnameASdeclare @sql varchar (400)set @sql = 'select convert(varchar(40),databasepropertyex(name, ''Status'')) as DB_Status, name, dbid, crdate, cmptlevelfrom [' + @Servername + '].master.dbo.sysdatabaseswhere databasepropertyex(name, ''Status'') <> ''ONLINE'''print (@sql)--GetOfflineDBInfo 'rtsioltp\data'
This does run successfully when I run it on the server called rtsioltp\data and use static names. When I take it to the server and run as it exists above with dynamic variables it runs successfully but only pulls a blank table. My theory is that I have to fully qualify the function databasepropertyex. But I can't find where this function is to even test the theory. Is it possible to fully qualify functions so they can be ran from other servers? ThanksCraig Greenwood