locked
SQL Passwords RRS feed

  • Question

  • What special characters cannot be used in a SQL 2008 password?
    Friday, December 14, 2012 8:44 PM

Answers

  • Hi,

    Most characters can be used, even CHAR(13), CHAR(10) and CHAR(9) (carriage return, line feed and tab), plus various symbols like ë, ñ, µ, ½, », §, etc.

    On the other hand, I tested CHAR(0) and doesn't work.

    I always recommend my users to avoid symbols that can't be easily typed on their keyboards (like µ in an American Keyboard).


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    Friday, December 14, 2012 9:02 PM
  • It is usually based on your windows level password policy mechanisms what they have set-

    Also incase if used OLE DB or ODBC connection string, a login or password must not contain the following characters: [] {}() , ; ? * ! @. These characters are used to either initialize a connection or separate connection values.

    http://msdn.microsoft.com/en-us/library/ms161962%28v=sql.100%29.aspx

    for ex- see

    http://msdn.microsoft.com/en-us/library/ms161962%28v=sql.100%29.aspx

    Password Policy

    When it is running on Windows Server 2003 or later, SQL Server can use Windows password policy mechanisms.

    SQL Server can apply the same complexity and expiration policies used in Windows Server 2003 to passwords used inside SQL Server. This functionality depends on the NetValidatePasswordPolicy API, which is only available in Windows Server 2003 and later versions.




    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

    Saturday, December 15, 2012 10:56 AM

All replies

  • Hi,

    Most characters can be used, even CHAR(13), CHAR(10) and CHAR(9) (carriage return, line feed and tab), plus various symbols like ë, ñ, µ, ½, », §, etc.

    On the other hand, I tested CHAR(0) and doesn't work.

    I always recommend my users to avoid symbols that can't be easily typed on their keyboards (like µ in an American Keyboard).


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    Friday, December 14, 2012 9:02 PM
  • It is usually based on your windows level password policy mechanisms what they have set-

    Also incase if used OLE DB or ODBC connection string, a login or password must not contain the following characters: [] {}() , ; ? * ! @. These characters are used to either initialize a connection or separate connection values.

    http://msdn.microsoft.com/en-us/library/ms161962%28v=sql.100%29.aspx

    for ex- see

    http://msdn.microsoft.com/en-us/library/ms161962%28v=sql.100%29.aspx

    Password Policy

    When it is running on Windows Server 2003 or later, SQL Server can use Windows password policy mechanisms.

    SQL Server can apply the same complexity and expiration policies used in Windows Server 2003 to passwords used inside SQL Server. This functionality depends on the NetValidatePasswordPolicy API, which is only available in Windows Server 2003 and later versions.




    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

    Saturday, December 15, 2012 10:56 AM
  • Hi,

    You're right.

    I tried a password with a * in the middle.

    It was OK for SSIS and SSMS, but couldn't log via ODBC.


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    Monday, December 17, 2012 1:41 PM
  • It was OK for SSIS and SSMS, but couldn't log via ODBC.

    IIRC, you may need to enclose the password in the connection string with single or double quotes when the password contains certain special characters.  This is a restriction of the API rather than SQL Server.


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/

    Monday, December 17, 2012 1:44 PM
  • http://msdn.microsoft.com/en-us/library/ms130822.aspx  -for ODBC

    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

    Monday, December 17, 2012 3:25 PM