Skip to content
Advertisement

Print within the SQL Server Select query based on the condition

I have this query from the link here which works fine, only that I am adding include FK constraints ‘ON Delete/ Update cascade’ if delete/update_referential_action is 1. I am unable to achieve the desired result. Any help appreciated.

Advertisement

Answer

Ms Sql 2016 dose not support if statement in middle of query. You must use case statement instead of it.

you need to change

to something like this

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement