We develop a SQL Server data recovery product. Now in a customer's database, we can get the definition of a DEFAULT object from the system base tables, as below:
CREATE DEFAULT [DF_TagTemplate_Version] AS ((1))0;
However, the definition has the following syntax error and cannot be executed:
Syntax error near '0'
So, I just wonder if there is a way to create a DEFAULT and bypass the syntax check on it?
We develop a SQL Server data recovery product. Now in a customer's database, we can get the definition of a DEFAULT object from the system base tables, as below:
CREATE DEFAULT [DF_TagTemplate_Version] AS ((1))0;
However, the definition has the following syntax error and cannot be executed:
Syntax error near '0'
So, I just wonder if there is a way to create a DEFAULT and bypass the syntax check on it?
Share Improve this question asked Jan 18 at 16:13 alanccalancc 8116 gold badges36 silver badges94 bronze badges 5 |1 Answer
Reset to default 3"we can get the definition of a DEFAULT object from the system base tables"
You're doing that wrong, obviously. If you're mucking around in the system base tables of a corrupted database, you're on your own for correctly extracting or reconstructing the object definitions.
DEFAULT
object is due to be removed from SQL Server anyway, there's probably not much point going down this route. You'd be better off translating them to aCONSTRAINT
. – Thom A Commented Jan 18 at 17:02CREATE DEFAULT [DF_TagTemplate_Version] AS ((1))0
? – Martin Smith Commented Jan 19 at 11:19