Incorrect syntax near 'PIVOT'

后端 未结 3 492
情歌与酒
情歌与酒 2021-01-19 00:23

I\'m running SQL Server 2008 R2. I\'m trying to build a table that takes data from a table structured like this:

company | ded_id | descr

10          1             


        
3条回答
  •  伪装坚强ぢ
    2021-01-19 01:03

    I had the same error (Incorrect syntax near 'PIVOT'...) and solved it by changing compatibility level in the Options section of database properties.

    I also found how to script the compatibility level change:

    ALTER DATABASE database_name   
    SET COMPATIBILITY_LEVEL = 100
    

    (see https://msdn.microsoft.com/en-us/library/bb510680.aspx?f=255&MSPPError=-2147217396)

提交回复
热议问题