Database
 sql >> Teknologi Basis Data >  >> RDS >> Database

Menghubungkan PolyBase ke Salesforce.com

PolyBase mengakses dan menggabungkan data non-relasional dan relasional, semuanya dari dalam SQL Server. Mulai dari SQL Server 2019, PolyBase mendukung data dari backend yang menyediakan driver ODBC.

Kami mencoba PolyBase dengan driver ODBC Salesforce kami, untuk meminta data Salesforce dari SQL Server 2019.

Untuk memulai:

  1. Instal dan lisensikan driver ODBC Salesforce.com pada mesin tempat SQL Server diinstal.

    Anda memerlukan build 2.0.3 dari driver ODBC Salesforce.com, yang saat ini tersedia dengan menghubungi Tim Dukungan Easysoft ().

  2. Di Microsoft SQL Server Management Studio, sambungkan ke instans SQL Server berkemampuan PolyBase Anda. Untuk memeriksa apakah PolyBase diinstal, jalankan kueri ini:
    SELECT SERVERPROPERTY ('IsPolyBaseInstalled') AS IsPolyBaseInstalled;

    Jika PolyBase diinstal, kueri ini akan mengembalikan:

    1
  3. Anda juga perlu memastikan bahwa PolyBase diaktifkan:
    EXEC SP_CONFIGURE @CONFIGNAME = 'polybase enabled', @CONFIGVALUE = 1;
    RECONFIGURE WITH OVERRIDE;
  4. Jika Anda belum melakukannya, mulai layanan PolyBase (SQL Server PolyBase Engine, SQL Server PolyBase Data Movement) di aplikasi Layanan Windows.
  5. Buat sumber data eksternal PolyBase:
    CREATE DATABASE PolyBaseDB
    
    USE PolyBaseDB
    
    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'p455w0rd';
    
    CREATE DATABASE SCOPED CREDENTIAL PolyBaseSalesforce
    WITH IDENTITY = 'myuser, Secret = 'p455w0rd';
    
    CREATE EXTERNAL DATA SOURCE salesforce_data_source
    WITH ( 
    LOCATION = 'odbc://Salesforce',
    CONNECTION_OPTIONS = 'DRIVER={Easysoft Salesforce ODBC Driver};
                          UID=mysalesforceuser@mydomain;
                          PWD=mypassword;TOKEN=1234ABCDEF;',
    CREDENTIAL = PolyBaseSalesforce
    );
    
  6. Buat tabel SQL Server lokal yang akan menyimpan data Salesforce jarak jauh. Tabel lokal ini untuk tabel Account Salesforce:
    CREATE EXTERNAL TABLE Account([Id] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL, [IsDeleted] TINYINT NOT NULL,
    	                      [MasterRecordId] NCHAR(18) COLLATE Latin1_General_CI_AS,
    			      [Name] NVARCHAR(255) COLLATE Latin1_General_CI_AS NOT NULL, [Type] NVARCHAR(255) COLLATE Latin1_General_CI_AS,
    			      [ParentId] NCHAR(18) COLLATE Latin1_General_CI_AS, [BillingStreet] NVARCHAR(4000) COLLATE Latin1_General_CI_AS,
    			      [BillingCity] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [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] NVARCHAR(4000) COLLATE Latin1_General_CI_AS,
    			      [ShippingStreet] NVARCHAR(4000) COLLATE Latin1_General_CI_AS, [ShippingCity] NVARCHAR(40) COLLATE Latin1_General_CI_AS,
    			      [ShippingState] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [ShippingPostalCode] NVARCHAR(20) COLLATE Latin1_General_CI_AS,
    			      [ShippingCountry] NVARCHAR(80) COLLATE Latin1_General_CI_AS, [ShippingStateCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS,
    			      [ShippingCountryCode] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [ShippingLatitude] FLOAT(53), [ShippingLongitude] FLOAT(53),
    			      [ShippingAddress] NVARCHAR(4000) COLLATE Latin1_General_CI_AS, [Phone] NVARCHAR(40) COLLATE Latin1_General_CI_AS,
    			      [Fax] NVARCHAR(40) COLLATE Latin1_General_CI_AS, [AccountNumber] NVARCHAR(40) COLLATE Latin1_General_CI_AS,
    			      [Website] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [PhotoUrl] NVARCHAR(255) 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, [Ownership] NVARCHAR(255) COLLATE Latin1_General_CI_AS, [TickerSymbol] NVARCHAR(20) COLLATE Latin1_General_CI_AS,
    			      [Description] NVARCHAR(4000) COLLATE Latin1_General_CI_AS, [Rating] 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] DATETIME2(0) NOT NULL, [CreatedById] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL,
    			      [LastModifiedDate] DATETIME2(0) NOT NULL, [LastModifiedById] NCHAR(18) COLLATE Latin1_General_CI_AS NOT NULL,
    			      [SystemModstamp] DATETIME2(0) NOT NULL, [LastActivityDate] DATE, [LastViewedDate] DATETIME2(0), [LastReferencedDate] DATETIME2(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, [SicDesc] 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] DATE)
    	WITH (LOCATION='Account', DATA_SOURCE= salesforce_data_source)
  7. Kueri data jarak jauh:
    SELECT Id FROM dbo.Account WHERE Id = '001i000000AOq3DXYZ'

  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Tips Wawancara Administrator Database SQL

  2. Menghubungkan ke Vertica di IRI Workbench

  3. Wawancara dengan Oren Eini dari RavenDB tentang manajemen basis data, analitik &keamanan

  4. Perpustakaan Jenis Tunggu SQLskills sekarang menampilkan data SentryOne

  5. RDBMS vs NoSQL