Home Forums SQL Server 2008 T-SQL (SS2K8) convert tSQL mySQL to MSSQL RE: convert tSQL mySQL to MSSQL
mickyT
SSChampion
Points: 10360
More actions
April 21, 2013 at 8:50 pm
#1608572
Hi
Try replacing your IF functions with a CASE statements, eg
if(rating = 5, 1, 0)
becomes
CASE WHEN rating = 5 THEN 1 ELSE 0 END
In SQL 2012 there is also the IIF function that could be used