Password Encryption and verification using SQL Server internal functions

Source: Internet
Author: User

Generally, SQL Server is used as the background database. The simplest and easiest way to encrypt user passwords and verify passwords is to use SQL Server's own functions, which is convenient, fast, and easy to use. However, it is worth noting that the English version of the operating system and the English version of SQL Server have always been used, and the password field type of the data table is set to any varchar type, then we can use pwdencrypt and pwdcompare built-in functions! However, the problem is that the Chinese version of the operating system and the Chinese version of the database are used, and the character set of the database is changed to the Chinese character set. The type of this password field is varchar and does not work.

Change the password field type to nvarchar. OK! The functions of the two functions work again!

Really speechless... little thing.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.