I have a computed column created with the following line:
alter table tbPedidos
add restricoes as (cast(case when restricaoLicenca = 1 or restricaoLote = 1
This is one of those situations where it can be easier and faster to just use the diagram feature of SQL Server Management Studio.
('')
or something equally innocuous (probably such that you don't change the column's datatype).Doing it this way in SSMS will retain the ordering of the columns in your table, which a simple drop...add
will not guarantee. This may be important to some.