Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
校验当前用户的口令。
sa_verify_password( curr_pswd )
curr_pswd 使用此 CHAR(128) 参数指定当前数据库用户的口令。
此函数返回 INTEGER 值。
此过程由 sp_password 使用。如果口令匹配,则返回 0,而且不会发生错误。如果口令不匹配,则诊断为一条错误。如果口令不匹配,则不会终止连接。
无
以下示例在当前用户为 DBA 或 User1 时尝试校验当前连接的口令。如果当前口令不匹配,则发生错误。
IF USER_NAME() = 'DBA' THEN SELECT sa_verify_password( 'sql' ); ELSEIF USER_NAME() = 'User1' THEN SELECT sa_verify_password( 'user' ); END IF;