Friday, March 23, 2012
How Many VarBinary for each Ascii Char Aes Encrypted KeySize=256,BlockSize=256
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table?
Phil
Boston, MA
It is character by character; so, a byte is a byte is a byte. VARBINARY is
byte by byte; so, VARCHAR(2) is VARBINARY(2). So, is your AES algorythm
fixed-length or variable?
Sincerely,
Anthony Thomas
"Phil C." <charlestek@.rcn.com> wrote in message
news:uPzGjKuGFHA.2360@.TK2MSFTNGP12.phx.gbl...
Hi. I'm wanting to encrypt customer name, address, etc. information using
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table?
Phil
Boston, MA
How Many VarBinary for each Ascii Char Aes Encrypted KeySize=256,BlockSize=256
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table'
Phil
Boston, MAIt is character by character; so, a byte is a byte is a byte. VARBINARY is
byte by byte; so, VARCHAR(2) is VARBINARY(2). So, is your AES algorythm
fixed-length or variable?
Sincerely,
Anthony Thomas
"Phil C." <charlestek@.rcn.com> wrote in message
news:uPzGjKuGFHA.2360@.TK2MSFTNGP12.phx.gbl...
Hi. I'm wanting to encrypt customer name, address, etc. information using
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table'
Phil
Boston, MA
How Many VarBinary for each Ascii Char Aes Encrypted KeySize=256,BlockSize=256
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table'
Phil
Boston, MAIt is character by character; so, a byte is a byte is a byte. VARBINARY is
byte by byte; so, VARCHAR(2) is VARBINARY(2). So, is your AES algorythm
fixed-length or variable?
Sincerely,
Anthony Thomas
"Phil C." <charlestek@.rcn.com> wrote in message
news:uPzGjKuGFHA.2360@.TK2MSFTNGP12.phx.gbl...
Hi. I'm wanting to encrypt customer name, address, etc. information using
Aes with a KeySize of 256 and a BlockSize of 256. Either for each ascii
character or say for a maximum length 50 characters for a field, how many
bytes will this generate and how do I translate
this into the number of VarBinary ?items that I allocate in my Sql Server
2000 table'
Phil
Boston, MA
Monday, March 19, 2012
how many chars in varchar record
How could I check how many chars are in record, defined as varchar(8000).
It's obvious that in such defined record could be 1 char to 8000 char. But
what query to SQL database should I post to give information about realy
lenght of this records ?
thanks from advance
AdamSee LEN() and "String Functions" in Books Online.
Simon|||Select len(field)
or
Select DataLength(field)
Madhivanan|||Be careful - the two functions are not the same. LEN() returns the
number of characters after removing trailing blanks, but DATALENGTH()
returns the number of bytes stored. So you can get different results if
trailing blanks are present, if you have varchar vs char, or if you use
Unicode columns - see the code below, and Books Online for more
details.
Simon
create table #t (v varchar(10), nv nvarchar(10))
insert into #t select 'X', 'X'
insert into #t select 'X ', 'X ' -- two trailing blanks
select len(v), datalength(v), len(nv), datalength(nv)
from #t
create table #t1 (c char(10), nc nchar(10))
insert into #t1 select 'X', 'X'
insert into #t1 select 'X ', 'X ' -- two trailing blanks
select len(c), datalength(c), len(nc), datalength(nc)
from #t1|||Thanks Simon
Madhivanan|||thanx for all for valuable information!
best wishes
Adam