The ALTER TABLE statement conflicted

前端 未结 1 1772
长情又很酷
长情又很酷 2020-12-18 19:54
alter FUNCTION [Kuri].[fnGetAge](@kuri_cust_Id int,@amt decimal)
RETURNS SMALLINT
AS
    BEGIN
    DECLARE @isVallid  bit = 0
    declare @payed decimal(14,2)
    de         


        
相关标签:
1条回答
  • 2020-12-18 20:25

    As the error clearly states: there are rows in your table that violate your check constraint.

    Since your check constraint tests for kuri.fnGetAge(kuri_Cust_ID,amt) >= 1, you can find those rows in violation of this check constraint using

      SELECT * FROM Kuri.Payment
      WHERE kuri.fnGetAge(kuri_Cust_ID, amt) < 1
    

    Fix or delete those rows, and then you should be fine and your ALTER TABLE command should work

    0 讨论(0)
提交回复
热议问题