我有列表:
ID int,
FirstName nvarchar(50),
Phone varchar(50),
Email varbinary(50) -- (use varbinary for unicode)
有存储过程,我想在此表中更新电话和电子邮件。这是我的程序的输入参数
@id int,
@Phone varchar(50),
@Email varchar(50)
更新时如何将电子邮件转换为 varbinary?当我这样更新时:
UPDATE myProcedure
SET [Phone] = @Phone,
[Email] = @Email
WHERE [ID] = @ID
有错误:Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.