Description:
I am not getting my Table comments when I Forward Engineer to SQL Server. What could be the reason?
Solution:
SQL Server stores the comments as an Extended Property. This also means it is looking for not just the Table, but also its Schema. The table needs a schema to produce the comments. For example, below we added DBO and got the following results:
CREATE TABLE [dbo].[E_1]
(
[a] char(18) NOT NULL
)
go
ALTER TABLE [dbo].[E_1]
ADD CONSTRAINT [XPKE_1] PRIMARY KEY NONCLUSTERED ([a] ASC)
go
EXEC sp_addextendedproperty
@name = 'MS_Description', @value = 'Entity definition',
@level0type = 'SCHEMA', @level0name = 'dbo',
@level1type = 'TABLE', @level1name = 'E_1'
go
EXEC sp_addextendedproperty
@name = 'MS_Description', @value = 'Attribute definition',
@level0type = 'SCHEMA', @level0name = 'dbo',
@level1type = 'TABLE', @level1name = 'E_1',
@level2type = 'COLUMN', @level2name = 'a'
go
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center