I already explained in the previous articles Split and convert Comma Separated String or any Delimited String to Table in SQL Server, Custom paging for GridView using DataList in ASP.NET using C#/VB.NET to increase SQL perfomance and How to List All Tables and Their Rowcount in SQL Server
DB Script:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE Enc_Dec
@username varchar(20),
@password varchar(10)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@encrypt_val VARBINARY(200)
SELECT
@encrypt_val = EncryptByPassPhrase('xxx', @password)
SELECT
@encrypt_val
INSERT INTO reg_users (username,r_pwd)VALUES(@username ,CONVERT(VARCHAR(200), @encrypt_val, 1))
SELECT CONVERT(VARCHAR(200),DecryptByPassPhrase('xxx', @encrypt_val ))
END
GO
|
The output of the above code as shown in the below figure.
No comments:
Post a Comment