Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Execute SQL Command vis SQL Task Editor with condition variable

$
0
0

This is so ridiculous... I am shy to ask!!!

I trying to call a SQL command using conditions.  So I created a parameter mapping to map the variable that I will use as a condition:

I configured the properties as follow:

I tried the query without any parameter to test it and it was working fine:

Declare @LoadType nvarchar(3)='CRI'
PRINT @LoadType
IF @LoadType ='CRI'
  TRUNCATETABLE CriticalList.tblCriticalList
ELSEIF  @LoadType='SRP'
   TRUNCATE TABLE CriticalList.tblStrategicResponseUnitList

Then I modified it to get the value of the variable mapped:

Declare @LoadType nvarchar(3)= ?
PRINT @LoadType
IF @LoadType ='CRI'
  TRUNCATETABLE CriticalList.tblCriticalList
ELSEIF  @LoadType='SRP'
   TRUNCATE TABLE CriticalList.tblStrategicResponseUnitList

Error message:

Am I doing something wrong???

 


Mylene Chalut


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>