sql - Syntax errors when migrating a .bak created in SQLServer 2000 to SQLServer 2008 then to SQLServer 2012 -


sqlserver 2012 sends me syntax error while executing stored procedure:

        doc.id_doc = @pi_id_doc         , doc.id_doc = det.id_doc         , det.recibo_concep = rec.recibo_concep         , doc.cuenta = cto.cuenta         , doc.cta_consec = cto.cta_consec         , cta.cuenta = cto.cuenta         , doc.cuenta *= lec.cuenta         , doc.cta_consec *= lec.cta_consec         , doc.bimestre *= lec.bimestre 

especially while using expresion "*=".

i executed same stored procedure no changes in sqlserver 2008 no problems.

does '*=' have meaning different '='?
there changes in syntax between sql server 2008 , sql server 2012?

*= (and =*) outer join using old-style syntax (syntax popular still in oracle, has been deprecated since sql server 2008 , officially discontinued in sql server 2012). syntax no longer supported , has many problems. info here:

bad habits kick : using old-style joins

you need re-write these queries modern left / right join versions in order make them compatible sql server 2012. should make new versions of queries , keep old versions, on 2008 instance, can validate re-writes return correct results.

erland sommarskog has guide might help:

become ansi star

this msdn forum thread might useful.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -