Endpoint Get Table Columns
Name
get_table_columns
Description
Parameters
| Parameter | Required | Options | ||||
|---|---|---|---|---|---|---|
|
Name:
Label: TableName |
YES | |||||
|
Name:
Label: DatasetId |
||||||
|
Name:
Label: WorkspaceId |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| Name |
DT_WSTR
|
nvarchar(200)
|
200 | |
| MinValue |
DT_WSTR
|
nvarchar(2000)
|
2000 | |
| MaxValue |
DT_WSTR
|
nvarchar(2000)
|
2000 | |
| Cardinality |
DT_I4
|
int
|
||
| MaxLength |
DT_I4
|
int
|
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use Power BI Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Required Parameters | |
|---|---|
| TableName | Fill-in the parameter... |
| Optional Parameters | |
| DatasetId | |
| WorkspaceId | |
| EnableCustomReplace | 1 |
| SearchFor | (?<=(\s*)({|,))(?<QuotedColumn>"\[(?<Column>.+?)\]")(?=:)--regex |
| ReplaceWith | "$4" |
API Destination
| Required Parameters | |
|---|---|
| TableName | Fill-in the parameter... |
| Optional Parameters | |
| DatasetId | |
| WorkspaceId | |
| EnableCustomReplace | 1 |
| SearchFor | (?<=(\s*)({|,))(?<QuotedColumn>"\[(?<Column>.+?)\]")(?=:)--regex |
| ReplaceWith | "$4" |
ODBC application
Use these SQL queries in your ODBC application data source:
Read table columns
<p>Gets columns of a specific table. Supply <code>TableName</code> in the <code>WITH</code> clause.</p>
SELECT *
FROM get_table_columns
WITH (TableName='MyTable')
Read table columns in a dataset
<p>Gets columns of a specific table in a specific dataset. Supply <code>TableName</code> and <code>DatasetId</code> in the <code>WITH</code> clause.</p>
SELECT *
FROM get_table_columns
WITH (TableName='MyTable',
DatasetId='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee')
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read table columns
<p>Gets columns of a specific table. Supply <code>TableName</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_table_columns
WITH (TableName=''MyTable'')';
EXEC (@MyQuery) AT [LS_TO_POWER_BI_IN_GATEWAY];
Read table columns in a dataset
<p>Gets columns of a specific table in a specific dataset. Supply <code>TableName</code> and <code>DatasetId</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_table_columns
WITH (TableName=''MyTable'',
DatasetId=''aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'')';
EXEC (@MyQuery) AT [LS_TO_POWER_BI_IN_GATEWAY];