If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mixing Exchange server with SQL Server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-04, 09:02
SHivan SHivan is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
Mixing Exchange server with SQL Server

I found the following post(see bottom of post) in the archive of this forum.
Does anyone know how you can use this technique to import data?

More precise I need to extract from the exchange server how much mail (in MB) each user gets each day, and save it in an SQL table. Does anyone kow what I need to alter to make this code do the trick?

I understand how to query yhe data, I just don't know how to "save" it in the DB



Thank you


SHivan



************************************************** *********

You can use SQL Server 2000's "Linked Server" and the Exchange OLE provider
to query as well as import data, for example:

-- Modify the following queries to point to your Exchange 2000 PF hierarchy
-- Add a linked server for the Exchange 2000 PF store
-- Note that the datasource named uses the Exchange 2000 domain name, not a
server name
exec sp_addlinkedserver 'E2K_PF', 'Exchange OLE DB provider',
'exoledb.DataSource.1',
'file:%5C\.\backofficestorage\visibility.exchg.com \public folders'

-- Query for a list of Contact entries in a PF
select convert(varchar(50), "urn:schemas:contacts:sn") as LastName,
convert(varchar(50), "urn:schemas:contacts:givenName") as FirstName
from openquery(E2K_PF,
'select "urn:schemas:contacts:sn",
"urn:schemas:contacts:givenName"
from scope(''shallow traversal of ".\Exchg\Atlanta\Atlanta Contacts"'')')

-- Examples for querying a specific mailbox in Exchange 2000:
-- Modify the following queries to point to a specific Exchange 2000 mailbox

-- Add a linked server for the Exchange 2000 mailbox
-- Note that the login you use to query with must have access to this
mailbox's folders
exec sp_addlinkedserver 'E2K_Administrator', 'Exchange OLE DB provider',
'exoledb.DataSource.1',
'file:%5C\.\backofficestorage\visibility.exchg.com \MBX\Administrator'
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On