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 2008 Forums
 Transact-SQL (2008)
 There is already an object

Author  Topic 

shank
Starting Member

6 Posts

Posted - 2012-01-26 : 10:02:56
Migrating from SQL2005 to SQL2008. Found a trigger was not firing and could not find the trigger. Tried to recreate the same trigger with the same trigger name that was used in SQL2005. I got this error: There is already an object named 'RMAUpdate' in the database. I cannot find this trigger anywhere. How can I search the database and find where this trigger might be?

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2012-01-26 : 10:15:46
select * from sys.objects where name = 'RMAUpdate'
Go to Top of Page

shank
Starting Member

6 Posts

Posted - 2012-01-26 : 10:40:47
I found it, but it doesn't show what table the trigger attached to. Where I expect it to be, it isn't.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-26 : 10:41:27
quote:
Originally posted by shank

Migrating from SQL2005 to SQL2008. Found a trigger was not firing and could not find the trigger. Tried to recreate the same trigger with the same trigger name that was used in SQL2005. I got this error: There is already an object named 'RMAUpdate' in the database. I cannot find this trigger anywhere. How can I search the database and find where this trigger might be?



you can even check sys.triggers as it will only have triggers info

IF EXISTS(SELECT 1 FROM sys.triggers WHERE name='RMAUpdate')
DROP TRIGGER RMAUpdate

http://msdn.microsoft.com/en-us/library/ms188746.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-26 : 10:42:44
quote:
Originally posted by shank

I found it, but it doesn't show what table the trigger attached to. Where I expect it to be, it isn't.


to get tablename use below query


SELECT OBJECT_NAME(parent_id) FROM sys.triggers WHERE name='RMAUpdate'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -