如果IsSuccess = 1
已存在UpdateID
行,我怎么能创建一个不接受行的表?
Create table myTable
(
UpdateID int,
IsSuccess bit,
)
UpdateID IsSuccess
-------- ---------
1 0 -- sucesss
1 0 -- success, There is no row for UpdateID = 1 where IsSuccess = 1
1 0 -- success, There is no row for UpdateID = 1 where IsSuccess = 1
1 1 -- success, There is no row for UpdateID = 1 where IsSuccess = 1
1 1 -- fails, There is row for UpdateID = 1 where IsSuccess = 1
1 0 -- fails, There is row for UpdateID = 1 where IsSuccess = 1
2 0 -- success, There is no row for UpdateID = 2 where IsSuccess = 1
2 1 -- success, There is no row for UpdateID = 2 where IsSuccess = 1
2 0 -- fails, There is row for UpdateID = 2 where IsSuccess = 1
2 1 -- fails, There is row for UpdateID = 2 where IsSuccess = 1