x

concatinate

I need help with this query please Demand contains name in mulpile (example jame dave, Daniel toy) which reference email addrees from email table Problem : result was blank because of the double names in Demand table

I am trying to write a query maybe (concatenate) which will pull the 2 email address from email table

 SELECT
               [Name]   = a.[name],
               [Demand] = a.[Demand],
               [Email]  = u.[email]
 FROM
               [appl] a
     LEFT JOIN [sys]  u ON u.[name] = [a].[demand];
more ▼

asked Dec 04 at 09:06 PM in Default

avatar image

klemmyjb
0

So your going to have to split the input string "jame dave, Daniel toy" into two parts, I recommend Jeff's delimited split function http://www.sqlservercentral.com/articles/Tally+Table/72993/ to do that to get the individual persons email address, then code around it to join the result set into a large string to pass into the mail, or as much as it pains me to say it a loop to loop through the result set to send individual mails

6 days ago anthony.green
(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x403

asked: Dec 04 at 09:06 PM

Seen: 24 times

Last Updated: 6 days ago

Copyright 2017 Redgate Software. Privacy Policy