?
Solved

Parameter substitution in DTS package

Posted on 2007-11-21
3
Medium Priority
?
966 Views
Last Modified: 2013-11-30
I have a DTS package containing two global variables, FromEmailAccount and ToEmailAccount.  (These variables are set at design time to normal looking email addresses.)  

The package also contains an Execute SQL task.  Here is the code for the task:

      declare @FromEMailAccount nvarchar(255)
      declare @ToEMailAccount  nvarchar(255)

      set  @FromEMailAccount = ? --Global Variable 'FromEMailAccount' assigned here
      set  @ToEMailAccount  = ? --Global Variable 'ToEMailAccount' assigned here

      update CheckValues
      set
            CheckValStr1 = @FromEMailAccount,
            CheckValStr2 = @ToEMailAccount



When I try to parse the query in the Execute SQL Task Properties dialog, I get a cryptic error message saying "Syntax error, permission violation or other non-specific error".  I get a similar error when I try to use the Parameters button.  

In order to assign the input parameters, I used disconnected edit and set the InputGlobalVariableNames property to "FromEMailAccount";"ToEMailAccount".    

Unfortunately, when the code runs only the first character of the global variables values is written into the CheckValStr1 and CheckValStr2 fields.  Why?  
0
Comment
Question by:DrLechter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 1500 total points
ID: 20336726
Does this work:

update CheckValues
      set
            CheckValStr1 = ?
            CheckValStr2 = ?

Are the global variables set the correct data types? You might want to use the Set Prpoerties task rather than a disconnected edit.

Lastly, this ~may~ help. It has some tricks you can use with parameters (when using SP's)

http://www.sqldts.com/234.aspx
0
 
LVL 4

Author Comment

by:DrLechter
ID: 20382004
Unfortunately, I couldn't solve this issue.   The article was interesting (I had already read it) but none of the infomration helped.  I wound up removing all the substituted parameters as a workaround.  Simpler is better in this case.

0
 
LVL 4

Author Closing Comment

by:DrLechter
ID: 31597117
I couldn't get it working.  But thanks for the effort anyhow!
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question