Home > database >  Can't modify the referenced method
Can't modify the referenced method

Time:09-28

One method to get the different time zones: dbo. F_GetLocalDate, because business need to be adjusted, in adjusting encountered the following error:
Message 3729, level 16, state 3, program F_GetLocalDate, line 1 [batches starting line 7)
Unable to ALTER dbo. F_GetLocalDate because objects' DF_Test_AddDate 'is a reference it,

The meaning of this error is the Test table AddDate in reference to this method (AddDate. Default value is dbo F_GetLocalDate this method),

There are a lot of the default value is in the form of field this method, can you tell me how to deal with here?

CodePudding user response:

SELECT
'_CONSTRAINT_=CN. The name,
'_SCHEMA_=S.n ame,
'_TABLE_=T.n ame,
'_COLUMN_=CL. The name,
'_FUNCTION_'='F_GetLocalDate' definition
The FROM
Sys. Default_constraints CN
INNER JOIN sys. Columns CL
ON CN. Parent_object_id=CL. Object_id AND
CN. Parent_column_id=CL. Column_id
INNER JOIN sys. Tables T
ON T.o bject_id=CL. Object_id
INNER JOIN sys. Schemas S
ON T.s chema_id=S.s chema_id
WHERE the definition='([dbo]. [F_GetLocalDate] ((8)))'
  • Related