Now lets say I make an update to the row where EmployeeID = 1
What I would like to do is use SQL Mail to email me all of the updated information based on a trigger. So in this case, I want SQL mail to return all colums and data where EmployeeID = 1.
The problem is I can't figure out how to do it.
Here is what my trigger looks like now.......I have tried some different ideas but none work. 2 things I would like to do and don't know how.
CREATE Trigger trg_employees
Declare @messageoutput varchar(255)
Declare @employeeid int
1) I would like to assign @employeeid to be equal to the EmployeeID of the newly updated row. Need help with this
@subject = 'Closed Service Order',
2) @query = I would like to be able to select * from Employees where EmployeeID = @employeeID but the problem is I don't know how to do this with variables. I should also mention one other small problem......I cannot make a reference to the inserted table within xp_sendmail. This was stated in the Microsoft Docs
So with that said I hope someone understands what my intentions are and can help.