Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encryption
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
01033938
Message ID:
01033944
Vues:
17
Increase the size of the ccpono column in the table to 180 bytes. Do you realize that you cannot decode the value produced by xp_repl_encrypt?

> 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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform