Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my password datatype is varchar.how to convert the varbinary datatype.
Posted
Updated 20-Nov-19 8:35am

Read the following : http://forums.asp.net/t/1071020.aspx[^]
 
Share this answer
 
Simple, by convert function:
SQL
declare @char nvarchar(100) = N'salam chetori'
declare @varbinary varbinary(100)
set @varbinary = convert(varbinary(max), @char)
select @varbinary
set @char = convert(nvarchar(max), @varbinary)
select @char
 
Share this answer
 
SELECT CONVERT(VARBINARY(25), '0x9473FBCCBC01AF', 1);
------------ the ,1 is important ---------------^^^


see sql server - Converting a VARCHAR to VARBINARY - Database Administrators Stack Exchange[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900