I have a SSIS package that uses a ForEach Loop Container to enumerate Excel files in a dir. I also have a Task Flow that inserts data from those Excel files into SQL Server.
I'm trying to insert the file names into a column into the same table in SQL Server by using a mapping variable in my stored procedure.
I'm having trouble with my MappingVariable at the end of the script with red squigglies. The following is my stored procedure script.
CREATE PROCEDURE [dbo].[Insert_F_STG_v2]
@Hrs float,
@Type nvarchar(100),
@SN nvarchar(100),
@Op nvarchar(100),
@[USER::CurrentFileName]
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO [CRM_RC].[dbo].[F_StgTbl]([Hrs], [Type], [SN], [Op], [Report_Date])
VALUES (@Hrs, @Type, @SN, @Op, @[USER::CurrentFileName])
END
The last @[USER::CurrentFileName] in the values block at the bottom of the script is the one giving me issues.
The following is the error:
Msg 102, Level 15, State 1, Procedure Insert_F_STG_v2, Line 95
Incorrect syntax near 'USER::CurrentFileName'.