You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you explicitly specify the dbo schema in front of the table, if comments are added to a column with EXEC sp_addextendedproperty (by specifying the dbo schema), these will not appear in the "note" of the columns concerned in the generated dbml via sql2dbml
Let's take the DDL noschema_specified_is_OK.sql
>>> cat ok.sql
CREATE TABLE mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql noschema_specified_is_OK.sql
Table "mytable" {
"a" int [note: 'This is the description of my column']
}
All is fine here.
Now try with specified_schema_is_OK.sql
>>> cat specified_schema_is_OK.sql
CREATE TABLE myschema.mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'myschema',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql specified_schema_is_OK.sql
Table "myschema"."mytable" {
"a" int [note: 'This is the description of my column']
}
All is fine here.
Now try with replacing myschema by dbo in file specified_dbo_is_NOK.sql
>>> cat specified_dbo_is_NOK.sql
CREATE TABLE dbo.mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql specified_dbo_is_NOK.sql
Table "dbo"."mytable" {
"a" int
}
In this case, there is a problem, the note corresponding to column's a comment doesn't appears
>>>sql2dbml --version
3.0.0
The text was updated successfully, but these errors were encountered:
benjdv
changed the title
sql2dbml dbo comment fail if dbo specified
sql2dbml dbo comment fail to generate note if dbo specified
Jan 9, 2024
benjdv
changed the title
sql2dbml dbo comment fail to generate note if dbo specified
sql2dbml fail to generate note if dbo specified
Jan 9, 2024
Hi,
When you explicitly specify the dbo schema in front of the table, if comments are added to a column with EXEC sp_addextendedproperty (by specifying the dbo schema), these will not appear in the "note" of the columns concerned in the generated dbml via sql2dbml
Let's take the DDL noschema_specified_is_OK.sql
All is fine here.
Now try with specified_schema_is_OK.sql
All is fine here.
Now try with replacing myschema by dbo in file specified_dbo_is_NOK.sql
In this case, there is a problem, the note corresponding to column's a comment doesn't appears
The text was updated successfully, but these errors were encountered: