how to insert value into temp table in encrypted format
this my sp i want to insert my pwd in encrypted format plz help me
ALTER PROCEDURE [dbo].[QueryEditor]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
Declare @TempTable Table
(
LID varchar(50),PWD varchar(50)
)
INSERT INTO @TempTable (LID,PWD) values ('Admin','Admin')
SELECT * FROM @TempTable
END
Loading

Javeed M ShaikhPosted Nov 14, 2011, 10:50 AM
try this...
ALTER PROCEDURE [dbo].[QueryEditor]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
Declare @TempTable Table
(
LID varchar(50),PWD varchar(50)
)
INSERT INTO @TempTable (LID,PWD) values ('Admin',pwdencrypt('Admin'))
SELECT * FROM @TempTable
END
you can use the pwdcompare() function to compare.
Unfortunately, this hash function is not very secure and can be broken using a dictionary-attack scheme. I would advise to use asymmetric cryptography encryption mechanism in your application and pass that to the database.