Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issue with update statement

Status
Not open for further replies.

luvmy2Js

IS-IT--Management
Sep 1, 2010
43
US
Could someone please help me out? I have an update statement that I am trying to do and it keeps giving me this error:

Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'CONVERT'.???

I have no clue what I am doing wrong..

Here is my code:

UPDATE ystdy_PA0000
SET
CONVERT(nvarchar, DecryptByKey([Action Type])) = 'Z1'
WHERE SAPID IN (910959, 520651, 520806, 910192, 910395, 910909, 520405, 525169, 910767, 521402, 522105, 522438, 521401, 520404, 521626)
and CONVERT(nvarchar, DecryptByKey([Action Type])) = 'ZI'


These are encrypted fields..

Thanks a million!!
 
UPDATE ystdy_PA0000
SET fieldname = 'Z1' WHERE SAPID IN (910959, 520651, 520806, 910192, 910395, 910909, 520405, 525169, 910767, 521402, 522105, 522438, 521401, 520404, 521626) and CONVERT(nvarchar, DecryptByKey([Action Type])) = 'ZI'
 
When I try that I get this error:

Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top