Skip to content

SMO 172.52.0, skips generation of "hidden" tables. #190

@sdonovanuk

Description

@sdonovanuk

If you create a table with this:

CREATE TABLE [dbo].[sysblah](
	[name] [sysname] NOT NULL,
	[principal_id] [int] NOT NULL,
	[diagram_id] [int] IDENTITY(1,1) NOT NULL,
	[version] [int] NULL,
	[definition] [varbinary](max) NULL
) 

And then create the extended-property to "hide" it, by making it look like a system-table:

EXEC sys.sp_addextendedproperty @name=N'microsoft_database_tools_support', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sysblah'

If you then use MSDE (or SMO via API), if you script the entire database (i.e. all objects) . . .

Then . . . you'll notice that the resultant script doesn't contain [dbo].[sysblah].

This seems like a bug. The intent is just to hide the table, not treat it as as "system table".

Weirdly, I've just SMO via C#, and even though you include the table in SelectedObjects, it (i) will NOT create the table but (ii) attempts to create the extended-property, which immediately fails because the table does not exist.

Thanks!

Sean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions