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 |