Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/09/2007, 11:43
Avatar de LUISESPOCH
LUISESPOCH
 
Fecha de Ingreso: octubre-2006
Mensajes: 194
Antigüedad: 17 años, 7 meses
Puntos: 0
Re: Problema con mi Trigger

Gracias iislas por tu comentario si me sirviò, sin embargo sigo necesitanto las variables porque hay una parte del trigger donde yo hago validaciones con estos valores capturados..., ah pero eso no es todo tengo otro problemilla con este mismo trigger...QUE NO ME GRABA NADA UNAS VARIABLES QUE ENCONTRÈ EN UN ARTICULO, y se trataba supuestamente de datos relacionados al servidor..

Es este:


CREATE TRIGGER [ddltrg_CREATE_TABLE_LOG] ON DATABASE -- Create Database DDL Trigger
FOR CREATE_TABLE -- Trigger will raise when creating a Table
AS
SET NOCOUNT ON
DECLARE @xmlEventData XML

-- Capture the event data that is created
SET @xmlEventData = eventdata()

-- Insert information to a EventLog table
INSERT INTO DDL_Trigger_Log.dbo.tblDDLEventLog
(
EventTime,
EventType,
ServerName,
DatabaseName,
ObjectType,
ObjectName,
UserName,
CommandText
)

SELECT REPLACE(CONVERT(VARCHAR(50), @xmlEventData.query('data(/EVENT_INSTANCE/PostTime)')),'T', ' '),
CONVERT(VARCHAR(15), @xmlEventData.query('data(/EVENT_INSTANCE/EventType)')),
CONVERT(VARCHAR(25), @xmlEventData.query('data(/EVENT_INSTANCE/ServerName)')),
CONVERT(VARCHAR(25), @xmlEventData.query('data(/EVENT_INSTANCE/DatabaseName)')),
CONVERT(VARCHAR(25), @xmlEventData.query('data(/EVENT_INSTANCE/ObjectType)')),
CONVERT(VARCHAR(25), @xmlEventData.query('data(/EVENT_INSTANCE/ObjectName)')),
CONVERT(VARCHAR(15), @xmlEventData.query('data(/EVENT_INSTANCE/UserName)')),
CONVERT(VARCHAR(MAX), @xmlEventData.query('data(/EVENT_INSTANCE/TSQLCommand/CommandText)'))

GO




PERO NO ME ESTA GRABANDO ESTOS VALORES... SE VAN NULOS... acaso necesitaría iniciar algun servicio adicional del SQL??

Gracias amigos por la ayuda..

Luis

Última edición por LUISESPOCH; 20/09/2007 a las 11:47 Razón: Faltas ortograficas