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:schema s:Customers:sn","urn:schemas:Customers:o","urn:sch emas:Customers:mailingstreet","urn:schemas:Custome rs:mailingstate","urn:schemas:Customers:mailingpos talcode","urn:schemas:Customers:mailingpostaladdre ss","
urn:schemas:Customers:mailingcity","urn:schemas:Cu stomers: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?
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.
"Mike" <yada@.yada.com> wrote in message news:42bf610c$1@.quokka.wn.com.au...
> 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:schema s:Customers:sn","urn:schemas:Customers:o","urn:sch emas:Customers:mailingstreet","urn:schemas:Custome rs:mailingstate","urn:schemas:Customers:mailingpos talcode","urn:schemas:Customers:mailingpostaladdre ss"
,"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?
>
Subscribe to:
Post Comments (Atom)
1 comment:
Hi all,
You can create a linked server from SQL Server 2000 to Microsoft Exchange Server 2000, by using the OLE DB Provider for Exchange, and executing the following script. Thanks a lot.....
Audit Public
Post a Comment