请帮忙,如何纠正这个程序?
现在,我收到一个错误:
不允许从数据类型 varchar 到 varbinary(max) 的隐式转换。使用 CONVERT 函数运行此查询。
代码:
CREATE PROCEDURE SP_FILEUPLOAD
@UID int,
@APPCODE varchar(50) = NULL ,
@APPEXPIRED datetime = NULL ,
@SIGNIMAGE image = NULL ,
@SIGNFILE varbinary(MAX) = NULL ,
@HEADUID int,
@PRINCIPALFROM money,
@PRINCIPALTO money,
@EXCEPTIONUSER bit,
@LastUpdate datetime
AS
BEGIN
SET NOCOUNT ON
INSERT INTO APPUSERDTL
(UID,
APPCODE,
APPEXPIRED,
SIGNIMAGE,
SIGNFILE,
HEADUID,
PRINCIPALFROM,
PRINCIPALTO,
EXCEPTIONUSER,
LastUpdate)
VALUES('@UID',
'@APPCODE',
'@APPEXPIRED',
'@SIGNIMAGE',
'@SIGNFILE',
'@HEADUID',
'@PRINCIPALFROM',
'@PRINCIPALTO',
'@EXCEPTIONUSER',
'@LastUpdate')
END
GO
下面是表结构
[dbo].[APPUSERDTL](
[UID] [int] NOT NULL,
[APPCODE] [varchar](50) NULL,
[APPEXPIRED] [datetime] NULL,
[SIGNIMAGE] [image] NULL,
[SIGNFILE] [varbinary](max) NULL,
[HEADUID] [int] NULL,
[PRINCIPALFROM] [money] NOT NULL,
[PRINCIPALTO] [money] NOT NULL,
[EXCEPTIONUSER] [bit] NOT NULL,
[LastUpdate] [datetime] NOT NULL )