IF NOT EXISTS (SELECT * FROM sys
IF NOT EXISTS (SELECT * FROM sys.symmetric_keys WHERE name = 'PrivateData')
BEGIN
CREATE SYMMETRIC KEY PrivateData WITH ALGORITHM = AES_256
ENCRYPTION BY PASSWORD='Pa$$w0rd'
END
GO
OPEN SYMMETRIC KEY PrivateData DECRYPTION BY PASSWORD ='Pa$$w0rd'
GO
CREATE TABLE UserData
(Data VARBINARY(255))
GO
DECLARE @Key_GUID UNIQUEIDENTIFIER
SELECT @Key_GUID = Key_GUID
FROM sys.symmetric_keys
WHERE Name = 'PrivateData'
INSERT INTO UserData
(Data)
VALUES
(EncryptByKey(@Key_Guid, 'RawData'))
GO
SELECT Data
FROM UserData
GO
SELECT CONVERT(VARCHAR(20), DecryptByKey(UserData.Data, 1)) AS Data
FROM UserData
GO
CLOSE SYMMETRIC KEY PrivateData
GO
DROP TABLE UserData
GO
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- ejercicios realización de consultas sql
- processing big data with azure data lake
- extension to sql view triggers cursor
- sql overview and highlights
- chapter 8 advanced sql
- m y s q l b y e x a m p l e s f o r b e g i n n e r s
- sql server alwayson errors related to availability groups
- if not exists select 1 from tempdb
- sql server and oracle
- about this document
Related searches
- python check if key exists in dictionary
- python check if key exists in map
- python check if directory exists and create
- check if class exists javascript
- jquery check if id exists on page
- jquery if class exists then
- check if id exists jquery
- check if variable exists javascript
- check if element exists js
- javascript check if element exists in dom
- check if object exists javascript
- python if file exists remove