As in title, I'm trying to create a table on SQL Server that includes computed column with if statement. I have already created basic columns, co currently trying to add computed column using ALTER TABLE.
In statement:
ALTER table zgodnosc add proba as IIF([Zmiana_1_postoj] = 0 ,-50,[Zmiana_1]) float;
I got error
Incorrect syntax near 'float'.
I've tried lots of combinations, always getting errors. Datatypes are: Zmiana_postoj_1 - bit, Zmiana_1 - int.
Does someone have a clue how to write that correctly?
Thanks!