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 04-19-2006, 12:05 AM by andeezlemoyo. 0 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

View as RSS news feed in XML