Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ObjectProperty returning Null Expand / Collapse
Author
Message
Posted Friday, April 04, 2008 4:42 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, February 20, 2014 1:22 PM
Points: 548, Visits: 1,010
Checking to see if a Trigger is enabled on a table or not.

I'm running the objectproperty function returning for the system id of the table and the property ExecIsTriggerDisabled. This is returning NULL. I know the id is correct, and I know the property is correct. It returns 1 for "HasInsertTrigger".

According to BOL NULL means the object doesn't exist (false) or the property doesn't exist (false). It also says you might not have permissions to view the property. I'm sa so I have.

Any ideas why this is returning NULL?

Oh and I realise I could just enable the trigger to make sure it is....but the table is replicated so it won't let me without dropping repl first. No thanks.

Cheers
Post #479809
Posted Friday, April 04, 2008 4:47 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 2:52 AM
Points: 870, Visits: 884
You're supposed to use the object id of the trigger, not the table.

select objectproperty(object_id('name of trigger'), 'ExecIsTriggerDisabled')



Karl
source control for SQL Server
Post #479811
Posted Friday, April 04, 2008 5:01 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, February 20, 2014 1:22 PM
Points: 548, Visits: 1,010
Cheers! haha. Works now.
Post #479820
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse