I have a SQL table and within this table there is a BIT column "IsComplete" that needs to be set if other columns have data within them.
The IsComplete was originally handled by a checkbox in the application, and I want to transfer the responsibility to the SQL DB to handle setting this “IsComplete” column to true based on the following:
IsComplete = true if column1 = [something] and column2 = [something] and column3 = [something]
IsComplete = false if column1, column2 or column3 is null or = [nothing]
How do I accomplish this.
You could Also have a computed column for this.
Just create a Function to receive the 3 paranmeters and return True if 3 parameters are not null and else False.
Then Create the column IsCOmplete ,and set it in Computed Column Specification
In formula use dbo.Yourfunction(column1,column2,column3)