HI
I m new to SQL server. Still as per my understanding "constraint check" can be applied on single column value and "rule" can be used where we want to validate all value of a single columns. For example, my table has following columns:-
username: varchar(50)
password: varchar(50)
Active: int ( It will have value 0 or 1, 0 mean Not active and 1 means Active )
I want to validate that only one row should contain "Active" = 1 at a time. It is possible that, no row have "Active" =1. But I should not happen that more that 1 row have "Active"=1 at an instance.
I m new to SQL server. Still as per my understanding "constraint check" can be applied on single column value and "rule" can be used where we want to validate all value of a single columns. For example, my table has following columns:-
username: varchar(50)
password: varchar(50)
Active: int ( It will have value 0 or 1, 0 mean Not active and 1 means Active )
I want to validate that only one row should contain "Active" = 1 at a time. It is possible that, no row have "Active" =1. But I should not happen that more that 1 row have "Active"=1 at an instance.
Comment