SSMA for Access, how to convert a field's switch statement to sql?

  • I have an Access DB. in that DB there is a table which has a field which contains a switch statement. I want to carry this function over to SQL. when I use the SQL Server Migration Assistant for Access it does not seem to carry this over. How can I achieve this? Is it a stored procedure? A view? I will be fine with manually entering it into the DB somehow if I need to. Bottom line I just need the ability the function had in access to be present in the SQL DB.

    the function looks in another table and checks the value of a field, based on that other field's value (null or not null) it will enter a boolean value in the original field.

  • php_guy (10/28/2014)


    I have an Access DB. in that DB there is a table which has a field which contains a switch statement. I want to carry this function over to SQL. when I use the SQL Server Migration Assistant for Access it does not seem to carry this over. How can I achieve this? Is it a stored procedure? A view? I will be fine with manually entering it into the DB somehow if I need to. Bottom line I just need the ability the function had in access to be present in the SQL DB.

    the function looks in another table and checks the value of a field, based on that other field's value (null or not null) it will enter a boolean value in the original field.

    Look at table TRIGGERS in MSSQL , then look at a CASE statement

    :CASE abc WHEN NULL THEN 0 ELSE 1 END

  • Thanks, I figured it would be a trigger. I could just not find an example that is similar. Mine will evaluate another table's column field and then create a boolean value based on that columns data after evaluation. Most examples I see simply take a value from another table and mine is simply more complex than that. But you gave the answer. I now need to just connect the dots. Also I think an INSTEAD OF INSERT type is what I need. But again the examples are not seeming to be plenty and most simply print something if the conditions are true and dont actually change any data in the DB, go figure

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

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