ALTER SERVER ROLE syntax error

  • HI all

    I am trying to run the following but I get a syntax near 'ROLE' error, but it looks ok to me, any ideas? I am using SQL 2012 SSMS against a SQL 2008 R2 instance.

    CREATE LOGIN [xxx\xxx] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]

    GO

    ALTER SERVER ROLE [sysadmin] ADD MEMBER [xxx\xxx]

    GO

  • This new syntax was only created with SQL 2012. you need to use sp_addsrvrolemember in 2008.

    Compare the two articles for 2008 R2 and 2012 and it makes sense. The syntax has only just been deprecated in 2012.

    If you look at the ALTER SERVER ROLE there's no "Other Versions" drop down.

  • Ah right, thanks

  • I did the same mistake thanks for the help 🙂 .....

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply