Solved

Parameter substitution in DTS package

Posted on 2007-11-21
3
961 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

726 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