# How to write coding to verify SQL Server password?

**URL:** <https://www.dynamicsuser.net/t/how-to-write-coding-to-verify-sql-server-password/9703>\
**Category:** Developers Forum\
**Created:** [February 16, 2005, 9:13am UTC](https://www.dynamicsuser.net/t/how-to-write-coding-to-verify-sql-server-password/9703 "2005-02-16T09:13:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bestianhow](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@bestianhow](https://www.dynamicsuser.net/u/bestianhow)\
**Post date:** [February 16, 2005, 9:13am UTC](https://www.dynamicsuser.net/t/how-to-write-coding-to-verify-sql-server-password/9703/1 "2005-02-16T09:13:44Z")

</div>

Hi, i have encounter a problem in my customizing Sales approval system. If Customer exceed their credit limit, system will prompt the user id and password screen for superior to approve. But i don’t know how to verify the user id and password using C/AL. I really you all help. Thank you very much.

---

<div class="post-metadata">

**Author:** ![StefanZimmer](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@StefanZimmer](https://www.dynamicsuser.net/u/StefanZimmer)\
**Post date:** [February 16, 2005, 10:01am UTC](https://www.dynamicsuser.net/t/how-to-write-coding-to-verify-sql-server-password/9703/2 "2005-02-16T10:01:49Z")

</div>

maybe this link is helpful [http://www.mbsonline.org/forum/topic.asp?TOPIC\_ID=233](http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=233) or search on “brute force” this forum. But i don’t think that this is working with the SQL-Authentication, because the table user contains no crypted password you can’t verify by the examples “brute force”… The users and even Passwords are stored in the master db, table sysuser. There is a stored procedure called sp\_Password with some interesting content for your question: //QUOTE\>\> – CHECK OLD PASSWORD IF NEEDED – if (@self = 1 or @old is not null) if not exists (select \* from master.dbo.sysxlogins where srvid IS NULL and name = @loginame and ( (@old is null and password is null) or (pwdcompare(@old, password, (CASE WHEN xstatus&2048 = 2048 THEN 1 ELSE 0 END)) = 1) ) ) begin raiserror(15211,-1,-1) return (1) end //\<\<QUOTE Maybe this help Bye Stefan
