May 26, 2008 at 11:54 am
Hello Gurus,
I have a Employee table with Employeemap column with ntext data type which contain
data like this
: Empname cheryl Gender M empid: 2333333
How to replace this information as binary image instead of text.
Thanks in advance
May 27, 2008 at 7:22 pm
Is possible to do ntext to binary are or not?
May 27, 2008 at 8:55 pm
Au4848 (5/27/2008)
Is possible to do ntext to binary are or not?
Not directly. I believe that you have to force it through some intermediate data types first, like:
Select @img = CAST(CAST(CAST(NtextColumn as nvarchar(max)) as varbinary(max)) as image)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 27, 2008 at 9:18 pm
I gotta ask... why is the data stored this way? It's mostly "death by SQL" and now you want to compound the problem by converting it to the equivelent of hex?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 27, 2008 at 9:20 pm
Jeff that was setup during design time which I'm not sure of it now I need scramble that column as binary instead of text ? Do you have any thoughts on it
May 27, 2008 at 9:30 pm
Sure... Barry is on the right track. Try that.
I guess I don't need to tell you that the column information stored in the NTEXT column should really be normalized into multiple columns, huh? Good thing I'm not on your team... I'd be looking for that designer... with my favorite slingshot and an extra large bucket of pork chops... every waking minute, too! Man, they messed up that database! And they're making it worse!
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2008 at 10:45 pm
Please tell me that the reason for changing this field to binary is not a half-assed attempt at "encryption"...
Regards,
Jacob
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply