Posted - 10/31/2013 : 20:42:52
| I am trying to write a t-sql script that will take the data in a field called USER_ID and retrieve the Base64 value and place it in a field called USER_DEFINED_01. Here's the statement:
UPDATE OGEN.GEN_M_USER SET USER_DEFINED_01 =
CAST(N'' AS XML).value(
SELECT CAST(USER_DEFINED AS VARBINARY(MAX)) AS bin
) AS bin_sql_server_temp;
I get the following response message:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'SELECT'.
The statement works fine if I don't include the update but the whole point of this project is to generate a base64 code and place it in the field.
Thank you for your help.