I know my title is confusing but I couldn't think of a better one for my question. So I have an application I am building that allows us to track projects and the associated tasks that is linked to a MS SQL database. The question I have is that my tasks table has some columns that are FK and can be null, when my application sends the data to the database to be stored sometimes those columns are null and sometimes they are not. The trouble is that the application doesn't want to send a null value, it wants to send 0 instead which causes errors on the SQL side as that is not a valid FK. So would it be better to handle this in the code somehow or to handle it in the SQL procedure by testing the value of the parameter and assigning it to 'null' if the value is 0? I know how to do it both ways I am just wandering which would be the better way.