Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-09-16 08:30
Flavor·PCRE (Legacy)

/
IF NOT EXISTS \(SELECT \* FROM sys\.objects WHERE object_id = OBJECT_ID\(N'\[(.*?)\]\.\[(.*?)\]'\) AND type = 'D'\) BEGIN ALTER TABLE \[(.*?)\]\.\[(.*?)\] ADD DEFAULT \(\(0\)\) FOR \[(.*?)\]
/
gm
Open regex in editor

Description

Search in sql script generated using SCA for the implicit constraint names and defining the name explicityly

Submitted by anonymous