How to fix incorrect syntax near ‘LOGIN’ in SQL Server 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahendra dubey
    New Member
    • Aug 2009
    • 16

    #1

    How to fix incorrect syntax near ‘LOGIN’ in SQL Server 2005

    I have SQl Server 2005 SP1.I am running following query
    ALTER USER [myuser] WITH LOGIN =[myuser]
    I have created both user and login with name myuser.

    but this query returns error

    Msg 102, Level 15, State 1, Server ..., Line 1
    Incorrect syntax near 'LOGIN'.
    Same query can be run on SQL server 2005 SP3,SQL Server 2008...
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Originally posted by mahendra dubey
    I have SQl Server 2005 SP1.I am running following query
    ALTER USER [myuser] WITH LOGIN =[myuser]
    I have created both user and login with name myuser.

    but this query returns error

    Msg 102, Level 15, State 1, Server ..., Line 1
    Incorrect syntax near 'LOGIN'.
    Same query can be run on SQL server 2005 SP3,SQL Server 2008...
    that's an incorrect syntax..

    http://msdn.microsoft.com/en-us/library/ms176060.aspx

    this link should help

    Comment

    • mahendra dubey
      New Member
      • Aug 2009
      • 16

      #3
      Originally posted by ThatThatGuy
      that's an incorrect syntax..

      http://msdn.microsoft.com/en-us/library/ms176060.aspx

      this link should help
      I have read the article, but not able to find where is incorrect syntax in query. If syntax is incorrect how it can run successfully on sql server 2005 sp3,sql server 2008...

      Comment

      Working...