如何从 sys.syslogins 表中解码密码 [英] How to decode password from sys.syslogins table

查看:39
本文介绍了如何从 sys.syslogins 表中解码密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,用户需要在其中使用用户名和密码登录.我正在检查主数据库中 sys.syslogins 表中的名称.但是对于密码,我收到一个带有(可能)这样的编码字符的字符串(1?????????????).现在我该怎么做才能解码该字符串并获取密码以与输入的密码进行比较?

I have a program in which the user needs to login with user name and password. I'm checking the name from the sys.syslogins table in master db. But for the password I receive a string with (probably) coded characters like this (1?????????????). Now what can I do in order to decode that string and take the password in order to compare with the enter it one?

推荐答案

试试这个:

SELECT name FROM sys.syslogins
WHERE pwdcompare('somepassword', password) = 1

编辑用单引号替换双引号.

这篇关于如何从 sys.syslogins 表中解码密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆