Error in Dynamic SQL
问题 I Have Created the following SP to generate the Update Statements and it uses the table Col.TMap.T_Mp and the data in the table looks like: ID M_Type ID_F SF1 SF2 1 Acc ACC_ID AC_ID NULL 1 STA STA_ID ST_ID NULL 1 CHa Cha_ID CH_ID NULL CREATE PROCEDURE dbo.dtmap( @ID INT ) AS BEGIN DECLARE @SQL NVARCHAR(MAX) DECLARE @SchemaName SYSNAME DECLARE @TableName SYSNAME DECLARE @DatabaseName SYSNAME DECLARE @M_Type SYSNAME DECLARE @SF1 VARCHAR(50) DECLARE @SF2 VARCHAR(50) DECLARE @ID_F VARCHAR(50)