Lowell, tried your suggestion...added convert but still it isnt working.....
Steve, i will create the table for security, but first i need to get this thing work....then i can create table and work on that stuff....
please let me know ur thoughts.....
USE [TriggerTest]
GO
/****** Object: Trigger [dbo].[ConfigTrigger] Script Date: 04/14/2013 21:57:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[ConfigTrigger]
ON [dbo].[ConfigSet]
AFTER INSERT, DELETE, UPDATE
AS
DECLARE @ConfigSetID_Ins varchar(100)
--DECLARE @ConfigSetID_Del varchar(100)
DECLARE @Body varchar(500)
Declare @Subject varchar(104)
Declare @Name varchar(100)
Declare @Version int
Declare @Timestamp binary(8)
BEGIN
Select @Subject = 'New record has been added in ConfigSet table in XXXXXX';
SELECT @ConfigSetID_Ins = C.ConfigSetID, @Name = c.Name, @Version = c.Version,
@Timestamp = c.[Timestamp]
from inserted i join ConfigSet C on I.ConfigSetID = C.ConfigSetID
--SELECT @ConfigSetID_Del = C.ConfigSetID
--from DELETED d join ConfigSet C on d.ConfigSetID = C.ConfigSetID
SET @body = 'New record '+'''' + Convert( varchar,@ConfigSetID_Ins) + ',' + @Name + ',' + Convert( varchar,@Version) + ' , ' +
Convert( varchar,@Timestamp) + ''''+' has been added to '+'CongifSet table in XXXX'
EXEC msdb..sp_send_dbmail
@profile_name = 'sqlserverdba',
@recipients = 'venkata@.com',
@subject = @subject,
@body = @body
END
GO