Got more questions? Find advice on: ASP | XML | Regular Expressions | Windows
in Search
Welcome to SqlAdvice Sign in | Join | Help

problem altering a function.

Last post 03-31-2009, 11:34 AM by s4Jrs. 1 replies.
Sort Posts: Previous Next
  •  04-19-2006, 12:05 AM 16596

    problem altering a function.

    Hi All,
    I created a user defined function in my sql server 2005 database and then set it as a computed column source in one of my tables. I was stunned when I went to modify the function and got this error:
    Msg 3729, Level 16, State 3, Procedure GetCommonPlantFamilyName, Line 10
    Cannot ALTER 'dbo.GetCommonPlantFamilyName' because it is being referenced by object 'bgd_PlantGenera'.
    Note: 'bgd_PlantGenera' is a table.
    I could see wanting this error if I was trying to drop the function, but I only want to modify its body. I'm not changing the function's interface or anything like that. What is the deal here? Is there a way around this error. Is there a command I can use in my alter procedure to bypass this error temporarily without having to dereference the function?

    Thanks,

    Andy

  •  03-31-2009, 11:34 AM 51890 in reply to 16596

    Re: problem altering a function.

    s4Jrs:
     

    Hi,

    Change the owner of the object or delete the object and recreate it.

    Regards,

    S4jrs

    Filed under:
View as RSS news feed in XML