SQL query not working in a different environment

I just published the application i was working from the local server to the cloud server, i am having an error executing my SQL code in the cloud server but it works fine in the local server.

here is the error I'm getting: an expression of non-boolean type specified in a context where condition is expected, near ')'

Any help would be appreciated. Thanks


Solution

Different SQL version?

I suspect that your boolean parameters are being misread on the server. Try replacing (@IsAdmin) by (@IsAdmin=1) and the same for @IsHome.

Solution

Nuno Reis wrote:

Different SQL version?

I suspect that your boolean parameters are being misread on the server. Try replacing (@IsAdmin) by (@IsAdmin=1) and the same for @IsHome.


Thanks, your solution worked!

My problem now is there's a lot of SQL queries in the application, changing every single SQL query would take a lot of time to fix. Is it possible to change SQL version of a specific application? i'm worrying if i change the SQL version  other application published in the cloud environment would be affected.

No. Even if you can have multiple databases, the database server is unique.

Talk with support. They can probably compare your local version with the server version and advice on how to proceed.



(you didn't hear this from me because it is ugly, but a quicker fix than edit all the SQL code would be to replace with inline parameters and send string "True" or "False" according to the value of the variables)