Questions tagged «policy-based-management»

1
SQL Server 2016中的表命名约定和策略管理问题
在SQL Server 2012中,我有一个策略设置为不允许表名中包含空格。但是,当我在SQL Server 2016中使用相同的策略时,出现错误。 这是条件的代码: DECLARE @condition_id INT EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'No Spaces', @description=N'No spaces in table names.', @facet=N'IMultipartNameFacet', @expression=N'<Operator> <TypeClass>Bool</TypeClass> <OpType>NOT_LIKE</OpType> <Count>2</Count> <Attribute> <TypeClass>String</TypeClass> <Name>Name</Name> </Attribute> <Constant> <TypeClass>String</TypeClass> <ObjType>System.String</ObjType> <Value>% %</Value> </Constant> </Operator>', @is_name_condition=4, @obj_name=N'% %', @condition_id=@condition_id OUTPUT SELECT @condition_id 这是该策略的代码: DECLARE @object_set_id INT EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Table Names_ObjectSet', @facet=N'IMultipartNameFacet', …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.