1

I want to export a list of email addresses ready to be copy and pasted into a distibution list for an email.

The select statement is simple:

select user_email from user_list where other = 'Y'

What do I need to do to add an ';' to the end of each email?

Im looking to product: [email protected];[email protected]; ect

2 Answers 2

1
DECLARE @List varchar(max) SET @List = '' SELECT @List = @List + ';' + user_email FROM user_list WHERE other = 'Y' SET @List = SUBSTRING(@List, 2, 2000000000) SELECT @List 
Sign up to request clarification or add additional context in comments.

Comments

0
select user_email,';' from user_list where other = 'Y' 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.