CONTEXT_INFO() used in constraints
molnara
Posts: 10
Hello,
It looks like SQL Compare is trying to put brackets on any constraints which use CONTEXT_INFO(). Take a look at the below script output from latest schema compare:
"CONSTRAINT [DF_Account_CreatedBy] DEFAULT (CONVERT([nvarchar](128),case when [CONTEXT_INFO]() IS NULL then suser_name() else [CONTEXT_INFO]() end,(0)))"
Notice the square brackets? SQL Compare is putting these there, my original constraint in source control looks like:
"CONSTRAINT [DF_Account_CreatedBy] DEFAULT (CONVERT([nvarchar](128),case when CONTEXT_INFO() IS NULL then suser_name() else CONTEXT_INFO() end,(0)))"
I am guessing this is a bug as it does not wrap suser_name() inside square brackets.
It looks like SQL Compare is trying to put brackets on any constraints which use CONTEXT_INFO(). Take a look at the below script output from latest schema compare:
"CONSTRAINT [DF_Account_CreatedBy] DEFAULT (CONVERT([nvarchar](128),case when [CONTEXT_INFO]() IS NULL then suser_name() else [CONTEXT_INFO]() end,(0)))"
Notice the square brackets? SQL Compare is putting these there, my original constraint in source control looks like:
"CONSTRAINT [DF_Account_CreatedBy] DEFAULT (CONVERT([nvarchar](128),case when CONTEXT_INFO() IS NULL then suser_name() else CONTEXT_INFO() end,(0)))"
I am guessing this is a bug as it does not wrap suser_name() inside square brackets.
Comments