我正在努力让这个语句运行
SET @SelectStatement = 'INSERT INTO [ArchiveProcessHistory] VALUES (' + @TableName + ',' + @TotalRowsSource +',' + @TotalRowsDestination + ',' + GetDate()') '
[我知道上述陈述有问题,我无法修复)
SET @FullStatement = @SelectStatement
ArchiveProcessHistory 表结构为:
TableName - nvarch(5)
TotalRowsSource - integer
TotalRowsDestination - integer
DateofInsert - Date
当我通过 sp_executesql 运行时,它给了我这个错误
消息 102,级别 15,状态 1,过程 usp_ArchiveTable,第 39 行 ')' 附近的语法不正确。
我该如何解决这个问题?