This commit is contained in:
Paul Trowbridge 2023-08-22 20:09:40 +00:00
parent 1504fdb24c
commit a06158cf6f

13
tds.md
View File

@ -20,17 +20,18 @@ create extension in postgres:
create foreign server: create foreign server:
``` ```
CREATE SERVER mssql_svr CREATE SERVER usmidsql01 FOREIGN DATA WRAPPER tds_fdw OPTIONS (servername 'usmidsql01', port '1433', database 'fanalysis', tds_version '7.1');
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 user mapping: 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: 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" and this will create a table call pricequote_dbo."UNCONTRAINED_COLUMNS"
create foreign table: create foreign table: