all groups > sql server connect > june 2005 >
You're in the

sql server connect

group:

Exchange Linked Server


Exchange Linked Server Mike
6/27/2005 12:00:00 AM
sql server connect:
I'm trying to run a view that calls a table in a linked server (linked to
Exchange on an SBS 03 box)

The linked server shows the correct tables in the Exchange public folders.

The query is;
CREATE VIEW dbo.vw_Exchange_Contacts
AS
SELECT CONVERT(nvarchar(50), [DAV:id]) AS DAVUID, CONVERT(nvarchar(50),
[urn:schemas:Customers:title]) AS Title, CONVERT(nvarchar(50),
[urn:schemas:Customers:sn]) AS Surname,
CONVERT(nvarchar(50), [urn:schemas:Customers:o]) AS Company,
CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingstreet]) AS
Mailing_Street, CONVERT(nvarchar(25), [urn:schemas:Customers:mailingstate])
AS Mailing_State,
CONVERT(nvarchar(25),
[urn:schemas:Customers:mailingpostalcode]) AS Mailing_Postal_Code,
CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingpostaladdress]) AS
Mailing_Postal_Address, CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingcity])
AS Mailing_City, CONVERT(nvarchar(50),
[urn:schemas:Customers:fileas]) AS FileAS, CONVERT(nvarchar(50),
[urn:schemas:Customers:telephoneNumber]) AS Tel,
CONVERT(nvarchar(50), [urn:schemas:Customers:givenName]) AS FirstName
FROM OPENQUERY(Exchange,
'SELECT
"DAV:id","urn:schemas:Customers:title","urn:schemas:Customers:sn","urn:schemas:Customers:o","urn:schemas:Customers:mailingstreet","urn:schemas:Customers:mailingstate","urn:schemas:Customers:mailingpostalcode","urn:schemas:Customers:mailingpostaladdress","urn:schemas:Customers:mailingcity","urn:schemas:Customers:fileas"
,"urn:schemas:Customers:telephoneNumber" ,"urn:schemas:Customers:givenName"
FROM "http://vj-sbs/public/Customers"')
Rowset_2

The problem is that the only field that is returned correctly is the DAV:ID
field; the rest are returned as NULL.

I've run the same sort of view on another SBS 2000 box correctly.

Any thoughts?

Re: Exchange Linked Server Mike
6/27/2005 12:00:00 AM
I should have added that if there is a better way to achieve the same thing,
i.e. bringing in the contacts from an exchange public folder then I'd also
love to hear about it.

Thanks in advance,

Mike
OnSite Applications.

[quoted text, click to view]

AddThis Social Bookmark Button