ALTER column of type varchar to varbinary

  • If I simply use following statement

    ALTER TABLE table_name ALTER COLUMN  col_name_pwd varbinary(1024) NULL

    I get following error

    Disallowed implicit conversion from data type varchar to data type varbinary, table 'table_name', column 'col_name_pwd'.

    Use the CONVERT function to run this query.

    I am little clueless for how do I use CONVERT and ALTER together !

    Appreciate your help.

     

     

  • Looks like you must do this in a few steps >>

    1 - Create the new column

    2 - Transfer the data from the old to the new column.

    3 - Drop te old column.

    I tried to do that in EM and it created a new table altogether so it doesn't seem possible to do it in one step.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply