0

when i use sha 512 on password field then it says k pasword field cannot be empty but when i remove sha512 constraint then it works and with any other hash it also works why ?
and plz suggest me some good secrity hash etc to apply on password field

Edited by HunainHafeez: spelling error

2
Contributors
7
Replies
8
Views
4 Years
Discussion Span
Last Post by HunainHafeez
0

Cannot insert the value NULL into column 'password',

this error :( when i used HASHBYTES('sha512',@password )

Edited by HunainHafeez

0
@fullname varchar(50),
    @email varchar(50),
    @password varchar(40),
    @question varchar(80),
    @answers varchar(100),
    @roleid int = 3

AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for procedure here
    insert into tblUser(fullname, email, password, question, answers,doc,roleid)
    values (@fullname,@email,HASHBYTES('sha1',@password),@question, @answers, GETDATE(),@roleid )
END
insert into tblUser(fullname, email, password, question, answers,doc,roleid)
    values (@fullname,@email,HASHBYTES('sha512',@password),@question, @answers, GETDATE(),@roleid )

    **Now when i execute EXEC statement like this :

exec dbo.appReg_sp "tom",'dd@hotmail.com','diedie','Your nick name ?','tommy'

**
then it gives the above error: Cannot insert the value NULL into column 'password',

but works for sha1 .why ?????

0

ohhhh my GOD :(
isn't there any alternaticve ?
or what if i use it from asp.net ,by creatinf class of it ?

1

Well sure, if you encrypt it in code (SHA512Managed class), then you can just store it.

Edited by pritaeas

0

and it worked and what about sha1 , is it secure mean hard to break ? using it is suggested ?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.