我們的客戶端發送CSV文件(平均30萬條記錄)該文件。我們在我們的Microsoft SQL數據庫中導入。數據庫加密:MSSQL 2008+數據庫加密並在Coldfusion中使用
從CSV文件導入數據時有沒有辦法,我可以加密(SHA &其他)?如何發送查詢(選擇,插入&更新)到數據庫?從Coldfusion或Microsoft SQL。
應用服務器:ColdFusion的9,9+和Lucee 數據庫:Microsoft SQL Server的2008+
對於實例IM已經使用mysql中。林在MSSQL尋找相同:
MYSQL例
INSERT:
INSERT INTO List_encrypted
(fname,Lname,email)
Values
(AES_ENCRYPT(fname,'dbkey'),
AES_ENCRYPT(Lname,'dbkey'),
AES_ENCRYPT(email,'dbkey'))
from List_encrypted
SELECT
select CAST(AES_DECRYPT(fname,'dbkey')AS CHAR (50)) AS FirstName,
CAST(AES_DECRYPT(Lname,'dbkey')AS CHAR (50)) AS LastName,
CAST(AES_DECRYPT(email,'dbkey')AS CHAR (50)) AS email
from List_encrypted
MYSQL IMPORT CSV DATA
LOAD DATA LOCAL INFILE 'C:\filename.txt'
INTO TABLE List_encrypted
CHARACTER SET utf8
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(fname,lname,email,stamp_dt)
SET
fname = AES_ENCRYPT(@fname,'dbkey'),
lname = AES_ENCRYPT(@lname,'dbkey'),
email = AES_ENCRYPT(@email,'dbkey'),
stamp_dt = now();
這就是我所做的在MSSQL: 我不知道如何加密,而進口
CREATE TABLE List_encrypted
(
ID int not null identity(1, 1) primary key,
LName varchar(255),
FName varchar(255),
email varchar(255),
);
BULK INSERT [List_encrypted]
FROM 'C:\filename.txt'
WITH
(
FIELDTERMINATOR = '" ; "',
ROWTERMINATOR = '\r\n'
)
您確定在*個人價值水平*上加密該數據庫首先是一個好主意嗎? – Tomalak
@Tomalak爲什麼我要做一些領域,因爲這些是最重要的領域。最佳做法是什麼?你建議? – IBM
通讀此拳頭:https://msdn.microsoft.com/en-us/library/bb510663(v=sql.110).aspx – Tomalak