I am trying to use Dynamic SQL for the first time. Now I understand the essence of this, but I'm trying to enter a parameter into the temp table using Dynamic SQL. I get an "Invalid column name" when I just try to type this as text, not intending to be a column.
In a side note, it's worth mentioning that I'm running this on SQL Server 2005.
This is my executable request.
SELECT ARCHV_FLAG,PATNT_REFNO,ACTIVE_NAMES,AINPT_REFNO INTO
Thank you very much in advance.
DECLARE @SQL NVARCHAR(4000), @SQL1 NVARCHAR(4000), @TABLE VARCHAR (100), @PK VARCHAR (50), @PATNT INT SET @PATNT = 1 CREATE TABLE
source share