Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Using Global Variable in SQL Task where statement

Author  Topic 

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2010-10-27 : 12:23:41
I have a global variable (package level) which is set at the beginning of my SSIS package.

I want to reference this variable within a where clause of a SQL task, see below:

select columnA from dbo.myTable
where columnB = + @[User::sys_name]

When I run the package, I get something similar to "Must declare the scalar variable "@".".

Can someone please tell me what is wrong with my syntax?

   

- Advertisement -