L&G.J

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

CREATE Function GetBFBin
(@tempRYDM VarChar(8),@tempType TinyInt)
Returns Char(510)
As 
Begin
        Declare @tempBin VarBinary(255),@tempStr VarChar(510)
        Select @tempBin=(Case @tempType
                When 0 Then LOGIN_PASSWORD
                When 1 Then CZQX1
                When 2 Then CZQX2
                When 3 Then CZQX3
                When 4 Then CZQX4
                When 5 Then CZQX5
                When 6 Then CZQX6
                End)
        From dbo.XTCZY Where PERSON_ID=(Select PERSON_ID
                From dbo.RYXX Where RYDM=@tempRYDM)
        Exec Master..XP_VarBinToHexStr @tempBin, @tempStr Out
        Select @tempStr=Right(@tempStr,Len(@tempStr)-2)

        Return @tempStr
End

posted on 2010-04-02 10:58  L&G.J  阅读(189)  评论(0编辑  收藏  举报