How to check whether a global function exists?

  • Hello everyone,

    I've tried searching for this without much luck - the search here on SQLServerCentral gives me a page with just a menu but no search results and searching Google didn't return anything I could use.

    The problem is that I need to check whether a string happens to be a SQL function.

    I know I can either search for local database functions and procedures in e. g. sys.objects, sys.all_objects, INFORMATION_SCHEMA.ROUTINES or use the object_id function, but globally available functions, such as getdate(), are not listed in those tables and the function doesn't seem to be able to find it either.

    Is there a way to find out whether a string is a global function or do I have to use TRY and CATCH to find out?

    Thanks in advance,

    Peter

  • There is an XML file SqlCommonObjects.xml with a description of all the built-in functions. Its default location is C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlToolsData\1033. Maybe you can try to read this file into SQL Server.

    Peter

  • Peter Brinkhaus (11/3/2009)


    There is an XML file SqlCommonObjects.xml with a description of all the built-in functions. Its default location is C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlToolsData\1033. Maybe you can try to read this file into SQL Server.

    Peter

    This'll do it, thanks 😀

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply