473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How do you get a memo field into an email sent by a trigger?

Hi everyone,

I am looking to get a memo field sent via email using a trigger. I have a table, and when a new line is added, a trigger is setup to send an email alerting a few people. There is a memo field in the table that I would like to include in the email, but when I tried to do that, it would not let me.

I did a little bit of research, and it seems that I can't use an Insert trigger for the memo field, but an Instead of trigger will work? I am not sure how to modify my code to make that work! Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. ALTER TRIGGER [dbo].[NewRowAddedtblBatchIDNotes] ON [dbo].[tblBatchIDNotes] AFTER INSERT AS
  2.  
  3. DECLARE @BatchID varchar (255)
  4.  
  5. SET @BatchID = (SELECT BatchID FROM inserted)
  6.  
  7.  
  8.  BEGIN
  9.  DECLARE @msg varchar(500)
  10.  SET @msg = 'Data has been imported!  BatchID ' + @BatchID + '. Please check the database for further information.'
  11.  --// CHANGE THE VALUE FOR @recipients
  12.  EXEC msdb.dbo.sp_send_dbmail @recipients=N'emailaddress@labs.com', @body = @msg,  @subject = 'New Data Submitted' , @Profile_Name = 'MyProfile'
  13. END
Nov 3 '16 #1
0 1268

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo...
0
by: MLH | last post by:
I'm rewording an earlier post with a more direct Subject description of my objective: I want to open eMail received from MAILER-DAEMON@ponyexpress.neonova.net and similar mail servers that is...
2
by: G.Gerard | last post by:
Hello Does anyone know how to get an entire memo field to be displayed in a combo box drop down list? Example - if the memo field contains the following : This is a test to see if
1
by: VRWC | last post by:
Hi folks, Hope someone has some insight to this problem. I have a form that contains a large (5" x 4") text box bound to a memo field. This field allows users to type in the text of an email...
0
by: Lauren Wilson | last post by:
The error does not have an error number. It's not even a normal Access error message box. Hope someone has some insight to this problem. I have a form that contains a large (5" x 4") text box...
1
by: dulcie | last post by:
I'm trying to put the contents of a college library onto an Access db - problem is the long list of research papers going into one particular cell of one particular field. I can change this to a...
1
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like...
7
by: midlothian | last post by:
Does using CStr on a memo field truncate it to 255 characters? Seems like this is happening with some data in my tables. Is there a way around this?
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.