Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encryption
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Encryption
Divers
Thread ID:
01033938
Message ID:
01033938
Vues:
58
Hi All,
I am trying to encrypt a credit card field in my account table. The ccNum filed is varchar(20) bit long. Below is my code:

declare @cardNumber2 varchar(180) ,
@cardNumber varchar(180)

set @cardNumber2 = (Select ccpono from accounts where accntid = 1)
Set @CardNumber = (Select ccpono from accounts where accntid = 1)
Set @CardNumber = char(39) + Rtrim(@CardNumber) + char(39)

exec master..xp_repl_encrypt @cardNumber output


Update Accounts
Set ccpono = @cardNumber
where accntid = 1

I get the following error when I execute my code.

Error
Server: Msg 8152, Level 16, State 9, Line 17
String or binary data would be truncated.
The statement has been terminated.

Any idea how to solve the issue?

Thansk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform