sp_help  sp_depends

Chapter 19: Triggers: Enforcing Referential Integrity

sp_helptext

To display the source text of a trigger, execute sp_helptext, as follows:

sp_helptext deltitle 
# Lines of Text
---------------
              1
text 
--------------------------------------------- 
create trigger deltitle 
on titles 
for delete 
as 
if (select count(*) from deleted, salesdetail 
where salesdetail.title_id = deleted.title_id) >0 
begin 
      rollback transaction 
      print "You can’t delete a title with sales." 
end 

If the source text of a trigger was encrypted using sp_hidetext, Adaptive Server displays a message advising you that the text is hidden. For information about hiding source text, see sp_hidetext in the Reference Manual.

If the System Security Officer has reset the allow select on syscomments.text column parameter with sp_configure (as required to run Adaptive Server in the evaluated configuration), you must be the creator of the trigger or a System Administrator to view the source text of a trigger through sp_helptext. (See evaluated configuration in the Adaptive Server Glossary for more information.)





Copyright © 2005. Sybase Inc. All rights reserved. sp_depends

View this book as PDF