|
Hello, I am new to SQL and very new to SQL 2005. I am trying to create a stored procedure for the first time using PIVOT. When I run the query, it looks great but as soon as I try to CREATE PROCEDURE, I get the error: Msg 102, Level 15, State 1, Procedure SP_IRProcedures, Line 90 Incorrect syntax near '(', which brings me to the open parentheses right next to the word PIVOT. I am not sure what to do to remedy the situtation. I have not included the entire query but can if necessary.
Thank you, Kelly
(comments are locked)
|
|
Is your database running under compatibility level 80, by any chance? Check this with sp_dbcmptlevel... If you want to change the compatibility level, then you can use ALTER DATABASE Compatibility Level. Be sure to read through this page carefully, because changing the compatibility level up does have implications.
(comments are locked)
|


Yes, it is at 80. It is supposed to be at 90, right...? I just read that. How do I make the change?
Thank you so much for responding so quickly!
Sorry, I didn't see this comment because you added it to your question rather than the answer! I've edited the answer below to include details on how to change it. And yes, 90 is the default compatibility level for 2005.