Assert verifies that table has default constraint with a given name and that this constrain have expected value. Fail when default constraint is not found or when default constraint value does not match expected value.


  • v_DefaultConstrant – Default Constraint name, SYSNAME
  • v_TableName – Table Name. Supports four part object name server.database.schema.object, SYSNAME
  • v_DefaultConstrantDefinition – SQL expression that defines default constraint. NVARCHAR(MAX)
  • v_UserMessage – message to report when assertion fails, NVARCHAR(MAX)

NOTE: Sample default constraint values

  • Numbers: ((0)), ((1.25))
  • String values: ('='), ('Disabled')
  • Functions: (getdate()), (newid()), (app_name()), (db_name()), (suser_sname())



SQL Server 

    'Invalid default value for AmIHidden column';

See Also