Source of a Function

  • Hi Team,

    am using a function (Fn_Split) in sql, i want to know that from where(in which stored procedure,etc) particular function is called.

    thank you in advance...

  • RedGate sqlsearch may be your best bet



    Clear Sky SQL
    My Blog[/url]

  • You can search stored procedure definitions by joining sys.objects to sql_modules and doing a WHERE clause with a LIKE statement on the definition column of sql_modules. That should locate all references to the function.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (11/28/2012)


    You can search stored procedure definitions by joining sys.objects to sql_modules and doing a WHERE clause with a LIKE statement on the definition column of sql_modules. That should locate all references to the function.

    and a code example of Brandi's suggestion:

    --kinda slow, took 11 seconds on my machine

    SELECT objz.name

    from sys.objects objz

    left outer join sys.sql_modules modz

    on objz.object_id = modz.object_id

    where definition like '%Fn_Split%'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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