From a06158cf6f37bc79bc26bd05528726c519c84120 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 22 Aug 2023 20:09:40 +0000 Subject: [PATCH] update --- tds.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tds.md b/tds.md index c8e975a..208617c 100644 --- a/tds.md +++ b/tds.md @@ -20,17 +20,18 @@ create extension in postgres: create foreign server: ``` -CREATE SERVER mssql_svr - FOREIGN DATA WRAPPER tds_fdw - OPTIONS (servername '127.0.0.1', port '1433', database 'tds_fdw_test', tds_version '7.1'); +CREATE SERVER usmidsql01 FOREIGN DATA WRAPPER tds_fdw OPTIONS (servername 'usmidsql01', port '1433', database 'fanalysis', tds_version '7.1'); ``` -`create server usmidsql01 foreign data wrapper tds_fdw options (servername 'usmidsql01', port '1433', database 'fanalysis', tds_version '7.1');` create user mapping: -`CREATE USER MAPPING FOR ptrowbridge SERVER usmidsql01 OPTIONS (username 'Pricing', password '');` +``` +CREATE USER MAPPING FOR ptrowbridge SERVER usmidsql01 OPTIONS (username 'Pricing', password ''); +``` to extract the schema into a single table that describes the schema do: -`IMPORT FOREIGN SCHEMA dbo FROM SERVER usmidsql01 INTO pricequote_dbo;` +``` +IMPORT FOREIGN SCHEMA dbo FROM SERVER usmidsql01 INTO pricequote_dbo; +``` and this will create a table call pricequote_dbo."UNCONTRAINED_COLUMNS" create foreign table: