dbTalk Databases Forums  

Convert NVARCHAR type column to VARBINARY type

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Convert NVARCHAR type column to VARBINARY type in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Axel Dahmen
 
Posts: n/a

Default Convert NVARCHAR type column to VARBINARY type - 03-26-2005 , 09:38 PM






Hi,

in my database I'd been using strings to store passwords. This was too easy
to read so I've converted this column's type to VARBINARY in my tables.

Now I want to transfer the old password data into the new column using
ActiveX Transformation Tasks. But how can I possibly convert a string into a
binary array?

I'd been testing this using a VBScript and an UPDATE query:

CREATE TABLE Test (inp NVARCHAR(32),outp VARBINARY(64))

...
DTSDestination("outp") = DTSSource("inp")
...

UPDATE Test
SET outp = CAST(? AS VARBINARY(64))
WHERE inp = ?

having:
inp Parameter 1
inp Parameter 2


But I get the error message: "ActiveX transformation 'DTSTransformation__1'
has encountered an invalid data value for destination column 'outp'."


Your help is quite appreciated.

Axel Dahmen



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.