April 19, 2015 at 7:34 pm
Hi,
I created a scalar user defined function and when I try to modify / alter the script, it just takes long time to execute.
So, I decided to delete it and re-create but it failed and saying I do not have permission.
I logon as SA and for testing sake, I set the permission to grant everything.
Is there anything I missed out ?
Thanks.
April 19, 2015 at 8:51 pm
davidku (4/19/2015)
Hi,I created a scalar user defined function and when I try to modify / alter the script, it just takes long time to execute.
So, I decided to delete it and re-create but it failed and saying I do not have permission.
I logon as SA and for testing sake, I set the permission to grant everything.
Is there anything I missed out ?
Thanks.
Can you find it in the Object Explorer after a "refresh"? If so, try the right-click and delete thing from there.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 19, 2015 at 9:49 pm
The function can been seen on the Object Explorer. I tried to delete but can't. Strange that I login as SA and said no permission.
It has some dependencies to other calling store procedures but my intention originally is to Alter so I can change the script inside the function. Since it is not do-able, I am trying to delete and re-create.
Still failed 🙁 also, the schema binding is FALSE.
April 19, 2015 at 9:56 pm
It might just be a bad error message. MS is sometimes pretty good at that. You might have to drop the proc that uses it (after saving its code, of course) but an ALTER should work on the function.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 19, 2015 at 10:27 pm
Let me do another test by changing the store procedure to point to a new function. Then delete the old one. Better approach than deleting all the store procedure and re-create.
April 20, 2015 at 3:14 pm
There could also be some type of locking, and thus blocking, on the underlying system tables. I've seen this happen when, for example, people do a "SELECT ... INTO new_table_name" in a non-tempdb db. But use of INFORMATION_SCHEMA in queries can also block system tables.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
April 20, 2015 at 7:59 pm
Ok, problem solved. I rebooted the database server.
As you guys suggested, locked processes ... it is correct. Something locked that function. Thanks for all your suggestions.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply