MSSQL: Table comments

Clarkey's profile image Clarkey posted 10 years ago in General Permalink
FYI, just reporting a bug.

The table comments do not work with MSSQL, nor can I see the code for MSSQL views (just blank).

Great software, use it all day everyday - thank you.
kalvaro's profile image kalvaro posted 10 years ago Permalink
Before Anse asks about it... SQL Server uses procedures and internal table properties to store comments. E.g.:

CREATE TABLE USER (
USER_ID INT IDENTITY(1, 1) NOT NULL,
CONSTRAINT USER_PK PRIMARY KEY (USER_ID)
);
EXEC sys.sp_addextendedproperty
@name=N'MS_Description',
@value=N'Application users',
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'USER';
EXEC sys.sp_addextendedproperty
@name=N'MS_Description',
@value=N'Auto-incremented ID',
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'USER',
@level2type=N'COLUMN',@level2name=N'USER_ID';

Code modification/commit 19df80e from ansgarbecker, 9 years ago, revision 9.3.0.4998
MSSQL: Fix broken query for altering column comment via table editor. See
* here: http://www.heidisql.com/forum.php?t=16947
* and here: http://www.heidisql.com/forum.php?t=18119
igitur's profile image igitur posted 9 years ago Permalink
r4998 was supposed to fix this, but I still can't see comments for tables. I also reported it in http://www.heidisql.com/forum.php?t=19576
igitur's profile image igitur posted 9 years ago Permalink
Sorry, I was confusing table comments and column comments. But neither work for me anyway.
ansgar's profile image ansgar posted 9 years ago Permalink
r4998 was supposed to fix altering column comments. Could it be that the query HeidiSQL is using to retrieve table structure does not reveal the column comments?
igitur's profile image igitur posted 9 years ago Permalink
Hmmm, really confused now. The original poster of this issue, Clarkey, posted about TABLE comments not working. In the commit log of r4998 you mention COLUMN comments.

I don't know whether reading and displaying TABLE comments work, but add/altering them doesn't work. I'll reply on the other thread about column comments.

Please login to leave a reply, or register at first.