Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encryption
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
01033938
Message ID:
01033944
Views:
15
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform