Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 xp_sendmail

Author  Topic 

svicky9
Posting Yak Master

232 Posts

Posted - 2006-08-30 : 12:26:41
Hi Friends

I am trying to generate a report from the following table using triggers and xp_sendmail

when i use the parameter @query as select * from employees it returns only the column names where as when you type in select employeeid from employees it returns the column data properly

whats the solution???

This is the sample trigger

alter TRIGGER Trigger_on_Table1
ON northwind.dbo.employees
FOR DELETE, INSERT, UPDATE
AS
BEGIN
exec master..xp_sendmail
@recipients = "vic",
@message = "The Table employees is modified",
@query = "select Employeeid,lastname,firstname,Title from Northwind.dbo.employees"
END
GO

Vic

nr
SQLTeam MVY

12543 Posts

Posted - 2006-08-30 : 12:30:07
>> using triggers and xp_sendmail
not a good idea

Is it a problem with the width of the data?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

svicky9
Posting Yak Master

232 Posts

Posted - 2006-08-30 : 12:41:03
i want to execute select * from employees but it does not execute it

When i try select <column names> from employees it works.

Can you please tell me why using triggers and xp_sendmail not a good idea :-)

Thanks in advance

Vic
Go to Top of Page
   

- Advertisement -