Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see DOMAIN_NAME values in INFORMATION_SCHEMA.COLUMNS #1388

Open
rc-ig opened this issue Nov 12, 2024 · 0 comments
Open

Can't see DOMAIN_NAME values in INFORMATION_SCHEMA.COLUMNS #1388

rc-ig opened this issue Nov 12, 2024 · 0 comments

Comments

@rc-ig
Copy link

rc-ig commented Nov 12, 2024

Environment

  • Python: 3.11.10
  • pyodbc: 5.2.0
  • OS: Ubuntu 22.04.5 LTS
  • DB: MS SQL Server
  • driver: ODBC Driver 17 for SQL Server

Issue

I am querying a database that uses user defined types, as described in the SQL Server documentation. The table 'MyTable' has fields that use one of these user defined types.

Using Azure Data Studio, if I submit the query
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MyTable'
I get a response with one row per field in MyTable with the following columns:

TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
ORDINAL_POSITION
COLUMN_DEFAULT
IS_NULLABLE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH
CHARACTER_OCTET_LENGTH
NUMERIC_PRECISION
NUMERIC_PRECISION_RADIX
NUMERIC_SCALE
DATETIME_PRECISION
CHARACTER_SET_CATALOG
CHARACTER_SET_SCHEMA
CHARACTER_SET_NAME
COLLATION_CATALOG
COLLATION_SCHEMA
COLLATION_NAME
DOMAIN_CATALOG
DOMAIN_SCHEMA
DOMAIN_NAME

The column DOMAIN_NAME contains the name of the user defined type where applicable, or NULL if a system defined type is used.

When I perform the same query using pyodbc, the response consists of 23 columns, but for every row the value in the DOMAIN_NAME field is None.

Is there anyway to determine where user defined types have been used in a table?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant