Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'DataPurityFlag', @description=N'', @facet=N'Database', @expression=N'<Operator>
  <TypeClass>Bool</TypeClass>
  <OpType>NE</OpType>
  <Count>2</Count>
  <Function>
    <TypeClass>Numeric</TypeClass>
    <FunctionType>ExecuteSql</FunctionType>
    <ReturnType>Numeric</ReturnType>
    <Count>2</Count>
    <Constant>
      <TypeClass>String</TypeClass>
      <ObjType>System.String</ObjType>
      <Value>numeric</Value>
    </Constant>
    <Constant>
      <TypeClass>String</TypeClass>
      <ObjType>System.String</ObjType>
      <Value>DBCC TRACEON (3604);&lt;?char 13?&gt;
CREATE TABLE #DBCC ( &lt;?char 13?&gt;
ParentObject VARCHAR(255)&lt;?char 13?&gt;
, [Object] VARCHAR(255)&lt;?char 13?&gt;
, Field VARCHAR(255)&lt;?char 13?&gt;
, [Value] VARCHAR(255) &lt;?char 13?&gt;
) &lt;?char 13?&gt;
&lt;?char 13?&gt;
INSERT INTO #DBCC EXECUTE (''''DBCC DBINFO WITH TABLERESULTS'''');&lt;?char 13?&gt;
&lt;?char 13?&gt;
SELECT Value FROM #DBCC&lt;?char 13?&gt;
WHERE Field = ''''dbi_DBCCFlags''''&lt;?char 13?&gt;
&lt;?char 13?&gt;
DROP TABLE #DBCC</Value>
    </Constant>
  </Function>
  <Constant>
    <TypeClass>Numeric</TypeClass>
    <ObjType>System.Double</ObjType>
    <Value>0</Value>
  </Constant>
</Operator>', @is_name_condition=0, @obj_name=N'', @condition_id=@condition_id OUTPUT
Select @condition_id

GO


