How to Create a List of Mail Recipients in an SQL Server

How to Create a List of Mail Recipients in an SQL Server thumbnail
SQL can be used to retrive a list of customer email addresses.

When you have a database of customers, you can use the tables and SQL Server queries to retrieve a list of email addresses. Included with an email list is the customer's first name (for the greeting) and last name. These three pieces of information are normally stored in the same customer table. A SQL Server query can be crafted to retrieve the information, which can then be copied and pasted into a simpler program like Excel to use for your email client.

Instructions

    • 1

      Open your SQL Server Management Studio console. For most installations, this is located in your "SQL Server" directory in the Windows Start menu.

    • 2

      Enter your user name and password to connect to the database that holds your customer table. You can also use the "sa" user name and password to connect with system administrator rights.

    • 3

      Right-click the database name in the right side of the window pane and select "New Query." This opens a window where you can type your query to retrieve customer emails.

    • 4

      Type the following code into the query console:
      select first_name, last_name, email from customer
      Your database fields may have different column names for the customers' first name, last name and email. To view your table's column names, double-click the customer table listed under your database name on the left side of the console.

    • 5

      Press the F5 key to execute the query. The query will execute and display results in a grid at the bottom of your screen.

    • 6

      Right-click the grid with your customer results and select "Save As." Select ".csv" format, which is a comma-delimited plain-text format readable by most email client applications. Your customer email list is now created.

Related Searches:

References

  • Photo Credit email simbol image by vladislav susoy from Fotolia.com

Comments

You May Also Like

Related Ads

Featured