I accidentally created a column with the wrong type NVARCHAR (for storing password salts) and I want to convert it to NVARBINARY.
I tried
ALTER TABLE [dbo].[TableName]
ALTER COLUMN [ColumnName] [varbinary] (20) NOT NULL
GO
but it says
Implicit conversion from data type nvarchar to varbinary is not allowed. Use the CONVERT function to run this query.
Is there a way to do that? CONVERT seems to be for expressions only, not for alterations.
The only way by altering will be someting like: