Foreign key functions
nfa
Posts: 2
Hello,
I have a problem when Redgate finds a function that is different. The function is used in a constraint so the constraint should be dropped before altering the function.
i.e.
ALTER TABLE [dat].[workflows] WITH CHECK ADD CONSTRAINT [CK_workflow#users] CHECK (([dat].[f_constraint_workflow_users]([client_id],[workflow_id],[active])='OK'))
The function dat.f_constraint_workflow_users is different and Redgate alters the function with an error:
Cannot ALTER 'dat.f_constraint_workflow_users' because it is being referenced by object 'CK_workflow#users'.
It's the same when a function uses an assembly, if the assembly is different the function that use the assembly is not dropped before the assembly is recreated. In this case I always remove the functions before I run Redgate so that I can live with.
But how do I solve the constraint problem?
Thanks.
/Niclas
I have a problem when Redgate finds a function that is different. The function is used in a constraint so the constraint should be dropped before altering the function.
i.e.
ALTER TABLE [dat].[workflows] WITH CHECK ADD CONSTRAINT [CK_workflow#users] CHECK (([dat].[f_constraint_workflow_users]([client_id],[workflow_id],[active])='OK'))
The function dat.f_constraint_workflow_users is different and Redgate alters the function with an error:
Cannot ALTER 'dat.f_constraint_workflow_users' because it is being referenced by object 'CK_workflow#users'.
It's the same when a function uses an assembly, if the assembly is different the function that use the assembly is not dropped before the assembly is recreated. In this case I always remove the functions before I run Redgate so that I can live with.
But how do I solve the constraint problem?
Thanks.
/Niclas
Comments
Sorry that you're experiencing this problem. Are you using SQL Compare or the SQL Comparison SDK? What version of the software are you using?
Redgate Software