jeudi 12 novembre 2015

SQL 2005 to 2012

I am in the midst of upgrading to SQL Server 2012 from 2005 and came across a syntax error that I need help with. The syntax error is actually in a database that was built in 2000 so the compatibility issue cannot be fixed in the settings.

    Select      PPB.*,      

    SUBSTRING(STUFF((select license_id as k   --*
    FROM LMACatscan..license AS L 
          WHERE L.archived = 0 
                AND ((L.ppb_id IN (SELECT ppb_id FROM LMACatscan..ppb WHERE ppb_id = PPB.ppb_id)) 
                OR (L.ppb_id_2 IN (SELECT ppb_id FROM LMACatscan..ppb WHERE ppb_id = PPB.ppb_id)))
                FOR XML PATH('')),1,0,''),2,999999)    
                FROM   LMACatscan..ppb AS PPB    
                WHERE  state_code > ''

The results from 2005 are: enter image description here From 20012 you can see the column with no name has that same value for all rows and this is where the problem is: enter image description hereAs always, any help is appreciated!

Aucun commentaire:

Enregistrer un commentaire