Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Can't see Triggers under Database/Tables/tableName/Triggers

I created a trigger a while ago and I wanted to go modify it. It is still working, but when I go to view the trigger for the table I can't see it listed. I was able to see it before. I'm logged in the same way and I am the dbo. Please help!!!

Thanks!
0
billkrieger
Asked:
billkrieger
  • 5
  • 4
  • 4
1 Solution
 
chapmandewCommented:
hmmm....thats odd.  If you want to see the text of the trigger, you can do it through tsql:

select object_definition(object_id('triggername'))
0
 
billkriegerAuthor Commented:
I can't recall the trigger name. Is there a way to get a listing of the triggers for a table?
0
 
chapmandewCommented:
sure...


select * from sys.triggers
where object_name(parent_id) = 'tablename'
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Louis01Commented:
This is a piece of script I use:
DECLARE @Column varchar(50)
SET @Column = '%FilterValueEntity%'
 
PRINT '--Tables and Columns'
SELECT O.name as objectName, C.name as ColumnName 
	FROM sys.columns C INNER JOIN sys.objects O 
		ON C.object_id = O.object_id
	WHERE C.name LIKE @Column
	ORDER BY O.name, C.name
 
PRINT '--Stored Procs'
SELECT name as ProcedureName, OBJECT_DEFINITION(OBJECT_ID) as ProcedureCode
	FROM sys.procedures
	WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE @Column
 
PRINT '--Triggers'
SELECT name as TriggerName, OBJECT_DEFINITION(OBJECT_ID) as TriggerCode
	FROM sys.triggers
	WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE @Column

Open in new window

0
 
billkriegerAuthor Commented:
ok... I'm going crazy. I ran the above and nothing was returned. I know the trigger is working, it is copying data from one field to another on insert.
0
 
Louis01Commented:
--Complete list of all triggers
SELECT name as TriggerName, OBJECT_DEFINITION(OBJECT_ID) as TriggerCode
      FROM sys.triggers
0
 
billkriegerAuthor Commented:
I ran select * from sys.triggers  without the WHERE clause & My trigger is listed???
0
 
Louis01Commented:
SELECT p.name as [table], o.name as [trigger]
      FROM sys.triggers t
            INNER JOIN sys.objects o
      ON t.object_id  = o.object_id
            INNER JOIN sys.objects p
      ON p.object_id  = o.parent_object_id

0
 
billkriegerAuthor Commented:
Thanks you!!!!!!!!!  So any Idea why I can't see it listed?
0
 
chapmandewCommented:
might be a permissions thing for some reason...
0
 
billkriegerAuthor Commented:
Thanks again!
0
 
chapmandewCommented:
Going to have to object on this one...am pretty sure I gave quite a bit of help.
0
 
Louis01Commented:
Object away chapmandew. I admit I initially thought the author could not remember the name of the trigger, and that is the solution I gave. I agree with you though that the solution is probably a permission one. Perhaps the author could shed some light on what actually solved his problem?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now