question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support REMARKS for columns and tables

See original GitHub issue

Driver version or jar name

Microsoft JDBC Driver 6.4 for SQL Server 6.4.0.0

SQL Server version

Microsoft SQL Server 14.00.3015

Client operating system

Windows 10

Java/JVM version

Java™ SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot™ 64-Bit Server VM (build 25.121-b13, mixed mode)

Table schema

CREATE TABLE Publishers
(
  Id INTEGER NOT NULL IDENTITY,
  Publisher VARCHAR(255),
  PRIMARY KEY (Id)
);
EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description', 
   'List of book publishers',
   'user', 'dbo', 'table', 'Publishers'
;
EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description', 
   'Unique (internal) id for book publisher',
   'user', 'dbo', 'table', 'Publishers', 'column', 'Id'
;
EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description', 
   'Name of book publisher',
   'user', 'dbo', 'table', 'Publishers', 'column', 'Publisher'
;

Problem description

DatabaseMetaData.getTables(...) and DatabaseMetaData.getColumns(...) does not return table and column descriptions in the REMARKS column. The REMARKS column should have the description from the extended properties.

Expected behavior and actual behavior

See above.

Repro code

Call DatabaseMetaData.getTables(...) and DatabaseMetaData.getColumns(...) .

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
diederik123commented, Feb 20, 2020

Hello @cheenamalhotra The current status of this point is not clear for me. I do not understand your comment from the 8th of May in combination with the changed statuses. Do you want to explain why this issue is closed? Thank you.

0reactions
cheenamalhotracommented, May 8, 2018

HI @sualeh

Extended properties” are meant to store Key-Value pairs for anything that can be useful for maintaining details about table/column. Adding additional property to the driver for reading these extended properties and finding out description does not sound a robust solution, as:

  1. It adds dependency for clients to configure connection property everytime they’re reading a description from “Extended properties” for a Table and then for a column - which mean 2 additional properties - leads to reconnect if different tables have different KEY for descriptions. Not all customers will always have same “KEY” for description they want to read.
  2. From driver’s perspective, if we are fetching 1 property for REMARKS, what about the other extended properties defined, there is no API that could read them - that becomes another issue.

In our point of view, these properties should be treated as “Extended properties” only, not to be mixed with Remarks and must be fetched as Key-value Pair array by calling fn_listextendedproperty in client applications.

Remarks on the other hand, is always returned NULL from SQL Server, and all SQL Server drivers follow same rule, including jTDS Driver, hence JDBC Driver should abide to that as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does Derby support table and column comments?
By 'table and column comments' you mean the ability to associate a comment (e.g. a description of the table / column) with the...
Read more >
Should I comment Tables or Columns in my database?
Microsoft SQL Server supports comments on both tables and columns, and it's pretty easy to set them through the IDE (Microsoft SQL ...
Read more >
How to View Comments for Tables and Columns in Oracle ...
To view comments for tables, select 'Tables' at the root of the treeview. · Click on a table in the Main View to...
Read more >
How to generate syntax for Comments of Tables and Columns ...
Solution: Yes, SQL Server does support Table and Column Comments and Forward Engeering from erwin DM also generates the needed syntax. However, ...
Read more >
H2 Remark support for columns and tables. - Liquibase Forum
Hello, I stumbled across a lack of support for remarks (comments) when dealing with H2 databases. H2 supports the SQL standard COMMENT ON…...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found