Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helptrigger

  No additional text.


Syntax
create procedure sys.sp_helptrigger
    @tabname		nvarchar(776),		-- Table name
	@triggertype	char(6) = NULL	-- Trigger type
as

declare @objid int,        /* id of the object */
		@dbname sysname

-- Check to see that the object names are local to the current database.
select @dbname = parsename(@tabname,3)
	   ,@triggertype = UPPER (@triggertype collate Latin1_General_CI_AS)
if @dbname is null
	select @dbname = db_name()
else if @dbname <> db_name()
	begin
		raiserror(15250,-1,-1)
		return (1)
	end

select @objid = object_id from sys.objects where object_id = object_id(@tabname) and type in ('U', 'V')
if @objid is null
	begin
		raiserror(15009,-1,-1,@tabname,@dbname)
		return(1)
	end

/*	Check that input type is update, INSERT, DELETE	*/
if @triggertype  is not null and not @triggertype in ('UPDATE', 'INSERT', 'DELETE')
      begin
         raiserror(15305,-1,-1)
         return(1)
      end

select
	trigger_name = name,
	trigger_owner = user_name(ObjectProperty( object_id, 'ownerid')),
	isupdate = ObjectProperty( object_id, 'ExecIsUpdateTrigger'),
	isdelete = ObjectProperty( object_id, 'ExecIsDeleteTrigger'),
	isinsert = ObjectProperty( object_id, 'ExecIsInsertTrigger'),
	isafter = ObjectProperty( object_id, 'ExecIsAfterTrigger'),
	isinsteadof = ObjectProperty( object_id, 'ExecIsInsteadOfTrigger'),
	trigger_schema = schema_name(schema_id)
	from sys.objects
	where parent_object_id = @objid and type IN ('TR','TA')
	AND (	@triggertype is NULL
		OR	( @triggertype = 'DELETE' AND ObjectProperty( object_id, 'ExecIsDeleteTrigger') = 1 )
		OR	( @triggertype = 'INSERT' AND ObjectProperty( object_id, 'ExecIsInsertTrigger') = 1 )
		OR	( @triggertype = 'UPDATE' AND ObjectProperty( object_id, 'ExecIsUpdateTrigger') = 1 ) )

return(0)  --sp_helptrigger

 
Last revision 2008RTM
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash