开发者

Import contacts from SQL Server to Outlook

I'm having some trouble getting personal contacts of some users I have in a database in SQL Server 2008.

I need to import into Outlook, so I can send an email to each one.

What is the best way for me to be able to connect to the database an开发者_开发技巧d get the contacts?

Thanks.


You can easily import contacts into Outlook with a .csv file.

  1. Open SQL Server Management Studio
  2. Connect to database
  3. Goto Tools > Options > Query Results > SQL Server > Results to Text
  4. Under Output format choose Comma Delimited
  5. Confirm the "Include column headers" box is checked
  6. Click OK
  7. Open a new query window
  8. Run your query

You should see the results as comma-delimited text. You can either copy and paste to a .csv file or re-run the query and send the results to a file (Ctrl + Shift + F).

For a screenshot, see this question.


I don't understand if what you need is put your SQLSERVER contacts in your OUTLOOK or the other way around.

If you need to put your SQLSERVER contacts into OUTLOOK:

  1. Use .NET Framework
  2. Connect to SQL server
  3. Do a query to get all the contacts you need
  4. Put them into Outlook using OLE

If you need to put your OUTLOOK contacts into SQLSERVER

  1. Use .NET Framework
  2. Connect to Outlook using OLE
  3. Get all the contacts you need
  4. Put them into SQLSERVER using insert sentences


If all you need is sending emails to contacts you have in an SQL Server table, you don't need to go through the hassle of importing them into Outlook.

Have a look at xp_sendmail.
It should be possible to have your mails send with a "simple" transact SQL script.

Some other links that might be usefull

  • Providing the User parameter.
  • Using Xp_sendmail With the Recipients Generated From a Query
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜