当我尝试执行此存储过程时,它给我的不是有效标识符错误有人可以帮助我吗?
CREATE Proc [dbo].[AddLogtrail]
@cmodule varchar(100),
@caudittype varchar(15),
@ctable varchar(100),
@cfield varchar(100),
@cfieldtype varchar(100),
@coriginalval varchar(100),
@cnewval varchar(100),
@cuser varchar(100),
@creason varchar(100) AS
DECLARE @SQL varchar (400)
set @SQL = 'Insert into AudittrailLog (ddatetime,cmodulename,caudittype,ctablename,cfieldname,cfieldtype,coriginalval,cnewval,cuser,creason) values ' +
'(convert(datetime,GETDATE(),105),'+@cmodule+','+@caudittype+','+@ctable+','+@cfield+','+@cfieldtype+','+@coriginalval+','+@cnewval+','+@cuser+','+@creason+')';
PRINT @SQL
Exec @SQL