Results 1 to 5 of 5

Thread: alter login fail...

  1. #1
    Join Date
    Mar 2003
    Posts
    383

    alter login fail...

    testing db on SQL2005 sp1.
    I tried to use following sql to change login password:

    ALTER LOGIN '12345_ABC' WITH PASSWORD = '321$ab'

    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near '12345_ABC'.
    Msg 319, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'with'.

    Then I took off single quote around 12345_ABC and ran with same error message.

    but with legacy sp_password it works.
    I also check and found the database property option is sql2000, then I changed it to SQL2005. But the running result is the same.

    thanks
    David

  2. #2
    Join Date
    Mar 2003
    Posts
    383
    Found that 2 brackets solve the issue. but not in the BOL...

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    from sql server 7.0 that is the standard. when you use special characters or numbers, spaces always use square brackets.

    example:
    Create table [This is a Test tables for $ and %] (id int)

  4. #4
    Join Date
    Mar 2003
    Posts
    383
    MAK:

    thanks for your final explaination. still will be nice if the BOL including this.
    -D

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    You can submit suggestions to Microsoft feedback site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •