We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Import Exchange Mailbox into SQL

Medium Priority
Last Modified: 2012-05-06
I would like to automatically check an Exchange mailbox and import the messages into a SQL 2000 Database.

What is the best way to do this? T-SQL? DTS?

If you have an example of a script to do this, that be excellent.

Thank you,
Watch Question

Hello Carmelo_Iorianni_NWCCAC,

You can do so by created a linked server to exchange as indicated below:


Then you could schedule a job in SQL Agent to check your email on a regular basis by creating a step (type: Transact T-SQL) that runs your code indicated in the link above. More info on how to setup a job:


Another possibility is to use SQL Mail and schedule a job again




Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Thank you,

When using xp_readmail, is there any way to retrive the accual address in CC field? Currently when I import the CC it just shows the firendly name (example for jon.doe@somewhere.com, it just shows doe, jon)

Thank you

Hmm, I don't think you can do so.
Have you tried using the linked server?
Thank you,  
From the links you provided, I was able to use xp_readmail to check a mailbox and import the messages into a MS SQL DB.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.