Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Possible Corrupt Function ?

Author  Topic 

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:20:53
Hello,

I have a function on my DB that appears to be corrupt.
Basically it won't let me make a change to it (It simply hangs on the hourglass)

I've also tried deleting the function, but again it hangs on the hourglass.

Does anyone know how I can get rid of this function and replace it with a copy ?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-27 : 11:23:11
HOW are you trying to delete the function?

Did you use
DROP FUNCTION dbo.fnThisIsMyFunction

in SSMS or QA? Or did you use SSMS or EM?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:28:29
Hi Peso,

Thanks for your response, I'm simply using Enterprise Manager, and Right Clicking then choosing Delete.

Also, I forgot to put in my original post - I can edit and delete other functions fine.
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:30:00
Hi Peso,

I've just tried this in QA aswell, and it simply hangs, saying "Executing query batch...." at the bottom.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-27 : 11:34:46
Do you have permissions?
What do DBCC tell you?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:40:05
Hi Peso,

Yes I do have permissions, and I can do the same with other functions etc.

I'll be honest and say I don't know what DBCC is ?
I am trying to feel my way round SQL with no training, as I've been landed right in it.

I'm ok with views and the syntax to an extent, but anything else and I'm a complete dummy I'm afraid !
Sorry.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-27 : 11:43:59
DBCC is an acronym for DataBase Consistency Checker.

Search Books Online for "DBCC CHECKDB".



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:48:48
Hi Peso,

I've just run this on the db, and it found the following :

CHECKDB found 0 allocation errors and 0 consistency errors in database 'SDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-27 : 11:51:17
I think something else is going on.

I can't delete a table in SSMS if I have the table open in a tab.
Maybe something similar here? Do you (or someone else) have the function "open" somehow?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2008-03-27 : 11:54:16
I don't, and nobody does directly.
However, I'm wondering if maybe the function is being used by the app in some way, as it's used to help users book holidays so maybe it's just a coincidence that I'm trying to delete it when people are attempting to book. (Unlikely but you never know)

Maybe I'll try again later on tonight when I know nobody should be using the application, and see what happens.
Go to Top of Page

craig79
Starting Member

33 Posts

Posted - 2008-03-28 : 02:16:54
Also try to query the syscomments table and get the exact definition of the function for further investigation.

You will get some help regarding other objects the function is referring to and try to figure out whether those objects are corrupt or not.

Go to Top of Page
   

- Advertisement -