Skip to content
Advertisement

SQL syntax for “if exists”

Why I’m getting this error:

My SQL query:

Thanks.

Advertisement

Answer

IF EXISTS only works in a stored procedure. Outside of a stored procedure, IF() is a function which takes 3 arguments. Proper usage would be

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