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 he says
Implicit conversion from nvarchar to varbinary data type is prohibited. Use the CONVERT function to run this query.
Is there any way to do this? CONVERT is presented only for expressions, not for changes.
sql-server sql-server-2008-r2
Andidog
source share