Declare @ field name nvarchar (255)
The set @ field name=source type
Select distinct target vouchers, @ the field names from [K001]
After execution system shows: message 207, level 16, state 1, 43 ranks' source type is invalid,
CodePudding user response:
DECLARE @ field name NVARCHAR (255);
The SET @ field name='source types;
EXEC (' credentials the select distinct goals, '+ @ field name +' from [K001] ');
CodePudding user response:
This kind of situation, you have to use splicing in the form of SQL, then use the exec to perform