SQL Server'da bir triger tanımını (gövdesini) nasıl alabilirim?
SQL Veritabanındaki tüm nesneleri listeler.
SELECT
sysobjects.type, sysobjects.name AS trigger_name,
OBJECT_NAME(parent_obj) AS table_name,
OBJECT_DEFINITION(id) AS trigger_definition
FROM sysobjects
P:PROCEDURE
TR:TRIGER
FN:FONKSİYON
Tüm trigerlerin tanımı listeler.
SELECT
sysobjects.name AS trigger_name,
OBJECT_NAME(parent_obj) AS table_name,
OBJECT_DEFINITION(id) AS trigger_definition
FROM sysobjects
WHERE sysobjects.type = 'TR'
Belli bir triger tanımı listeler.
SELECT
DB_NAME() AS DataBaseName,
dbo.SysObjects.Name AS TriggerName,
dbo.sysComments.Text AS SqlContent
FROM
dbo.SysObjects INNER JOIN
dbo.sysComments ON
dbo.SysObjects.ID = dbo.sysComments.ID
WHERE
(dbo.SysObjects.xType = 'TR')
AND
dbo.SysObjects.Name = 'Trg_FISMASTER_FISNO_Insert'
Hiç yorum yok