Transact SQL :- List Default Constraints

Background List SQL Server Default Constraints. Metadata If one decides to use Sequences, one has to be able to document where it is being used. Identity Columns Identify Columns has self documenting tooling. Inclusive :- sys.columns is_identity sys.identity_columns OBJECTPROPERTY TableHasIdentity ¬†COLUMNPROPERTY IsIdentity Sequence There is really nothing like a Sequence Column. They are defined outside … Continue reading Transact SQL :- List Default Constraints

Transact SQL :- Error – Msg 15138 – “The database principal owns a schema in the database, and cannot be dropped”

Background Cleaning up a database as we move it from Development to Production. Recreate Drop User SQL Error Msg 15138 Error Text Error Image   Troubleshoot Metadata sys.schemas SQL Output Explanation Schema db_datareader The owner for the db_datareader schema has been assigned to a database account, other than itself Remediate Change Schema Owner ALTER AUTHORIZATION … Continue reading Transact SQL :- Error – Msg 15138 – “The database principal owns a schema in the database, and cannot be dropped”