0

I have batch of user accounts and every user account's password is not crypted.I want to insert to user accounts to the database using SQL Insert Query but I want to hash the passwords while insert like ASP.Net MVC hashing mechanism in the query.

Is it possible , if it is how can I handle this?

Thanks

tcetin
  • 851
  • 1
  • 19
  • 38

1 Answers1

0

You can use HASHBYTES function for this. In my query i am hashing using MD5 algorithm.

INSERT INTO Userdetails_Tab(username,passwd,..,..)
values('test',HASHBYTES('MD5','testpass'),..,..)
Akshey Bhat
  • 7,901
  • 1
  • 18
  • 20