No ENUM in MSSQL...Workaround with CHECK?

  • Hi!

    How do I define an expression for a column, that only two possible inputs "T" and "P" are allowed?

    best regards

    /gü

  • You could do this with a check constraint, but the best solution would be to create another table with the "T" and "P" values as the primary key - and then some description field to tell people what those values mean. Then use a foreign key constraint to your table.

  • Thank you!

    It is a good idea to let the SQL server handle this problem.

    best regards

    /gü

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply