PolyBase tilgår og kombinerer både ikke-relationelle og relationelle data, alt sammen inde fra SQL Server. Fra og med SQL Server 2019 understøtter PolyBase data fra backends, for hvilke en ODBC-driver er tilgængelig.
Vi prøvede PolyBase med vores Salesforce ODBC-driver for at forespørge Salesforce-data fra SQL Server 2019.
Sådan kommer du i gang:
- Installer og licenser Salesforce.com ODBC-driveren på den maskine, hvor SQL Server er installeret.
Du skal bruge build 2.0.3 af Salesforce.com ODBC-driveren, som i øjeblikket er tilgængelig ved at kontakte Easysoft Support Team ().
- I Microsoft SQL Server Management Studio skal du oprette forbindelse til din PolyBase-aktiverede SQL Server-instans. For at kontrollere, om PolyBase er installeret, skal du køre denne forespørgsel:
SELECT SERVERPROPERTY ('IsPolyBaseInstalled') AS IsPolyBaseInstalled;
Hvis PolyBase er installeret, vil denne forespørgsel returnere:
1
- Du skal også sikre dig, at PolyBase er aktiveret:
EXEC SP_CONFIGURE @CONFIGNAME ='polybase aktiveret', @CONFIGVALUE =1;GENKONFIGURER MED TILSIDE;
- Hvis du ikke allerede har gjort det, skal du starte PolyBase-tjenesterne (SQL Server PolyBase Engine, SQL Server PolyBase Data Movement) i Windows Services-applikationen.
- Opret en ekstern PolyBase-datakilde:
CREATE DATABASE PolyBaseDBUSE PolyBaseDBCREATE MASTER NØGLE-KRYPTERING VED PASSWORD ='p455w0rd';CREATE DATABASE SCOPED CREDENTIAL PolyBaseSalesforceWITH IDENTITY ='myuser_CREATE_0rd' ='odbc://Salesforce',CONNECTION_OPTIONS ='DRIVER={Easysoft Salesforce ODBC Driver}; UID=mysalesforceuser@mitdomæne; PWD=mypassword;TOKEN=1234ABCDEF;',CREDENTIAL =PolyBaseSalesforce);
- Opret en lokal SQL Server-tabel, der skal indeholde de eksterne Salesforce-data. Denne lokale tabel er til Account Salesforce-tabellen:
CREATE EXTERNAL TABLE Account([Id] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL, [IsDeleted] TINYINT NOT NULL, [MasterRecordId] NCHAR(18) [COLLATE Latin_1_Gen, COLLATE Latin_1_Gen, NVARCHAR (255) Samler latin1_general_ci_as ikke null, [type] nvarchar (255) collect latin1_general_ci_as, [parentid] nChar (18) collect latin1_general_ci_as, [BillingStreet] Nvarchar (4000) collate latin1_general_ci_as, [BillingScity] collate (4000) collate latin1_general_ci_as, [Billingcity] BillingState] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [BillingPostalCode] NVARCHAR(20) COLLATE Latin1_General_CI_AS, [BillingCountry] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [BillingStateCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [BillingCountryCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [ BillingLatitude] FLOAT(53), [BillingLongitude] FLOAT(53), [BillingAddress] NVARCHA R (4000) Collect Latin1_General_CI_AS, [ShippingStreet] NVARCHAR (4000) COLLATE LATIN1_GENAL_CI_AS, [ShippingCity] NVARCHAR (40) COLLATE LATIN1_GENAL_CI_AS, [ShippingState] Nvarchar (80) collate latin1_general_ci_as, [ShipiPIPIPECHODE (80) COLLATE LATIN1_GENANAL_CI_AS, NVARCHAR(80) COLLATE Latin1_General_CI_AS, [ShippingStateCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [ShippingCountryCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [ShippingLatitude](LituShipping)(LituShipping)5CH0Address), [FLOAT]3CH00 COLLATE Latin1_General_CI_AS, [Telefon] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [Fax] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [AccountNumber] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [Fax] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [AccountNumber] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [VARCHAR_General_CICH)(Website]NVARCHAR_General_CHUCH, COLLATE_General_CICH)(CIA5)(N) COLLATE Latin1_General_CI_AS, [Sic] NVARCHAR(20) COLLATE Latin1_General_CI_AS, [Industry] NVARCHAR(255 ) COLLATE Latin1_General_CI_AS, [AnnualRevenue] FLOAT(53), [NumberOfEmployees] INT, [Ejerskab] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [TickerSymbol] NVARCHAR(20) COLLATE Latin_1_0CIGener Latin_1_0Gener Latin_1_0Gener Latin_1_0Gener] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [Site] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [OwnerId] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL, [CreatedDate] DATETIME_CreatedDate] NOTreated TIME_CIIICHATE(y) NVARCHAR(255) , [LastModifiedDate] DATETIME2(0) NOT NULL, [LastModifiedById] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL, [SystemModstamp] DATETIME2(0) NOT NULL, [LastActivityDate] DATE, [LastTIMEL (0), [Jigsaw] NVARCHAR(20) COLLATE Latin1_General_CI_AS, [JigsawCompanyId] NVARCHAR(20) COLLATE Latin1_General_CI_AS, [AccountSource] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [Si cDesc] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [CustomerPriority__c] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [SLA__c] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [Active__c] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [NumberofLocations__c] FLOAT(53), [UpsellOpportunity__c] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [SLASerialNumber__c] NVARCHAR(10) COLLATE Latin1_General_CI_AS, [SLAExpirationDate__c] DATO) MED (LOCATION='Konto', DATA_SOURCE=salesforce_data_source)Forespørg på fjerndataene:
SELECT Id FROM dbo.Account WHERE Id ='001i000000AOq3DXYZ'