dbTalk Databases Forums  

SSIS 2005, parameter mapping

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS 2005, parameter mapping in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Truc H.
 
Posts: n/a

Default SSIS 2005, parameter mapping - 10-04-2006 , 09:38 AM






Hi,
I created an Execute SQL task.
In the Editor / Parameter mapping,
I added the following parameter :
System:ackagename ==> @PkgName

In the SQL text property of the task :
Select col1 From TableName Where PackageName = @PkgName

Parse the query. Got Error message:
"The query failed to parse. Must declare the scalar variable "@PkgName"."
Question : Why @PkgName is not recognized ?


Reply With Quote
  #2  
Old   
Charles Kangai
 
Posts: n/a

Default RE: SSIS 2005, parameter mapping - 10-04-2006 , 11:57 AM






Use question mark instead of the explicit parameter name, @PkgName.

i.e.
Select col1 From TableName Where PackageName = ?

when you do the mapping, use 0 instead of the actual parameter name.

Charles Kangai, MCT, MCDBA
Author of Learning Tree's 4-day course: "SQL Server 2005 Integration
Services" http://www.learningtree.com/courses/134.htm
Author of Learning Tree's 4-day course: "SQL Server Reporting Services"
http://www.learningtree.com/courses/523.htm
email: charles at kangai.demon.co.uk


"Truc H." wrote:

Quote:
Hi,
I created an Execute SQL task.
In the Editor / Parameter mapping,
I added the following parameter :
System:ackagename ==> @PkgName

In the SQL text property of the task :
Select col1 From TableName Where PackageName = @PkgName

Parse the query. Got Error message:
"The query failed to parse. Must declare the scalar variable "@PkgName"."
Question : Why @PkgName is not recognized ?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.