can't find udf when this sp has been run

  • Hi Folks,

    I have created user defined function in SSMS but I cannot find the function under Programmibility> function > scalar -valued function when the following statement in run when I create the function. If I leave it out then it is ok. Does anyone know what this statement is about?

    EXEC [sys].[sp_addextendedproperty] @name = N'microsoft_database_tools_support', @value = N'1', @level0type = N'SCHEMA', @level0name = N'chk4crystal', @level1type = N'FUNCTION', @level1name = N'fn_get_answer_for_alias';

    GO

  • The statement you have there is an extended property. It doesn't create functions. Instead it is used to document and describe objects already created within the database. You can lookup sp_addextendedproperty in the books online to see what it can do. To read the properties back out use fn_listextendedproperty. It's also possible within SSMS to right click an object and bring up it's property sheet. At the bottom of the property sheet, on the left, is a page for Extended Properties. There you can see all the extended properties for the object in question.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • thanks Grant.. would it make a difference if I ran the create function definition/statement before running the extended property statement because that is what I did.

  • So, if you run the TSQl to create your function, you can't see it? Are you looking through the GUI? If so, make sure you're hitting refresh. If you can see the function, you're saying running the extended property proc is making it go away?

    I can't reproduce it. You should check your service pack & hot fixes. If you're up to date, go to connect.microsoft.com and log this as a bug.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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