In SSIS Execute SQL Task, Single-row Result From Querying Mysql Binding With A Variable
Jul 20, 2007
I set up a connection to mysql using ADO.NET's ODBC Data Provider. And I'm running a simple query to return one table's maximum ID(int32 unsigned). There is no problem to achieve that.
But when I bind the result to a variable and excute task. It gives out error message: "An error occurred while assigning a value to variable "MaxAuditLogID": "Result binding by name "MaxID" is not supported for this connection type. "
I tried to change the type of variable around but with no luck.
I set up a connection to mysql using ADO.NET's ODBC Data Provider. And I'm running a simple query to return one table's maximum ID(int32 unsigned).But when I bind the result to a variable and excute task. It gives out error message: "An error occurred while assigning a value to variable "MaxAuditLogID": "Result binding by name "MaxID" is not supported for this connection type. " I tried to change the type of variable around but with no luck.
I cannot find the data type for parameter mapping from Execute SQL Task Editor to make this works.
1. Execute SQL Task 1 - select max(columnA) from tableA. ColumnA is varbinary(8); set result to variable which data type is Object.
2. Execute SQL Task 2 - update tableB set columnB = ? What data type should I use to map the parameter? I tried different data types, none working except GUI but it returned wrong result.
Does SSIS variable support varbinary data type? I know there's a bug issue with bigint data type and there's a work-around. Is it same situation with varbinary?
I am building this as an expression, but it is not working. I am trying to return the row count into a variable to use later in an update statement. What am I doing wrong? I am using a single row result set. I have one variable defined in my result set. I am receiving an error stating: Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_SingleRow". Any help is appreciated!
SELECT count(*) FROM hsi.itemdata a JOIN hsi.keyitem105 b on a.itemnum = b.itemnum JOIN hsi.keyitem106 c on a.itemnum = c.itemnum JOIN hsi.keyitem108 d on a.itemnum = d.itemnum WHERE a.itemtypegroupnum = 102 AND a.itemtypenum = 108 AND b.keyvaluechar = " + (DT_WSTR,2)@[User::Branch] + " AND c.keyvaluechar = " + (DT_WSTR,2)@[User:epartment] + " AND d.keyvaluesmall = " + (DT_WSTR,7)@[User::InvoiceNumber] + ")
I have an sproc that gives an xml result set. I want to save this to a file but by using ssis and script task. Now, I do exec usp_myProc in execute sql task and get the result as xml. (I can get it as result set too but niether has worked). Now I pass this variable to my script task User::XRset.
In the script task I create a file and then I want to write xml result of User::XRset to my file. I am at loss.
I need to use a variable as column in SQL statement in Execute SQL task of integration services. I am setting Parameter Setting to map variable use it in the query like; select ? , col1name from tablename. But its not working. Anybody having any idea; would be of great help.
I am having a hard time setting the executable path for an Execute Process Task in SSIS. I have a variable that is initialized at package statup which holds the path to an executable in Windows. When I set the property "Executable" Path in an expression, I get a warning that the path for the executable is not set. One workaround was to try and initialize the variable with a bogus path with the hopes that the "correct" value will be written on run-time. NO LUCK. I still get the error and I cannot run the package until I put a static path.
I have an Execute SQL Task that executes "select count(*) as Row_Count from xyztable" from an Oracle Server. I'm trying to assign the result to a variable. However when I try to execute I get an error: [Execute SQL Task] Error: An error occurred while assigning a value to variable "RowCount": "Unsupported data type on result set binding Row_Count.".
Which data type should I use for the variable, RowCount? I've tried Int16, Int32, Int64.
In the Control flow tab, I have an Execute SQL Task that outputs full Result set into a variable of an object type. Now how can I write the contents of the Full Result Set into a text file using Script Task. I also want to format the following way while I output into a file:
Column Name 1 : Column Value
Column Name 2: Column Value and so on
I tried writing the contents of the Object Variable into a file, but the file had an output of single word: System.__ComObject.
Code for Writing the Full Result Set into a Text File
Dim RSsqloutput as String = Dts.Variables("objVariable").Value.ToString
Dim strVal as String = "File completed on " & Now() & vbCrLf & "------------------------------------------------------" & vbCrLf
I'm looking for a way to refer to a package variable within any Transact-SQL code included in either an Execute SQL or Execute T-SQL task. If this can be done, I need to know the technique to use - whether it's something similar to a parameter placeholder question mark or something else.
FYI - I've been able to successfully execute Transact-SQL statements within the Execute SQL task, so I don't think the Execute T-SQL task is even necessary for this purpose.
On an Execute Process Task, are there properties I can examine to determine the outcome of a process? I know that I can use a Success/Failure constraint to direct my workflow appropriately, depending on the outcome, but I would prefer the workflow continue on to the same task regardless, and then be able to change the flow later on based on the outcome of the process.
I see there is an ExecValueVariable property, and this may be what I'm looking for, but I have no idea what this is and can not find any documentation on it. I tried using it, but kept getting a runtime error trying to set it to a variable.
I know that a process returns a numeric value, and it would be nice if I could store this somewhere.
i need to know how many rows are in a certain table and store this value in a variable in order to process this variable later in the package. of course i can build a data flow task within a row count component but as far as i understand it's necessary to read all data from a data source in order to use the row count component. now the question is if it's possible to use a sql task in the control flow and put a select count(*) statement within the task and then write the result of this select statement into a variable. shouldn't that be much more faster than using a whole dataflow for this problem?
I am getting the following error when I execute my sql task:
An error occurred while assigning a value to variable "NullVar": " NO result rowset is associated with the execution of this query. "
I am executing a SP that has one input & one output parameter. The output parameter is returning a single row for debugging if the sp failes. I tried using Jamie's method:(http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx) to get it to work but keep getting the above error. I have the following variables:
In the execute sql task, I set the ResultSet to single row. I set SQLSourceType = variable & sourcevariable = user::SqlSource. In the result tab, I added a result set, NewResultName with the variable user::NullVar. I tried different configurations with the parameter mappings but nothing seemed to work. I didn't know if i still had to use this if I am using the sqlSource variable to drive the task.
So I am not sure what I am missing here. Anyone have any suggestions?
I have looked thru several similar threads with errors like this, but have not found a resolution. I have a SQL Task that runs this query:
Code Snippet select NetRevenue = cast(sum(Base_Price + AL + MI + PO) as dec(10,2)) from Lancelot.DataWhse.dbo.GrossMarginDetail where tran_date_key <= ? + ' 23:59:59' and label_group <> 'X' and not (ar_ship_key in ('S999991','S998101''S998102')) and Document <> 'Cust Bal Debit Memo'
There is a parameter mapping of "User::LastSaturday" of type date. I also have a result set with a result set name of "0" with a variable name of "User::GrossMargin," which is defined as a double in the package. The task has a resultset type of Single row, and at the moment the answer that is returned is 66228637.10.
If I change the package variable to a type of string it of course works, but then I cannot do comparisons against it. I have step by step manually copied this from an existing DTSX, so I am baffled why this isn't working, and I'm ready to throw myself under a truck!
I also tried to bring it in as a string, then convert it in a script task, but I cannot figure out how to reference the input and output variables. I can't seem to find any relevant docs on how to do that...
If anyone has any ideas, I and my sanity would greatly appreciate it.
I am building a simple package that looks at the results of a sql query, prior to running the next step.
Basically Outline and settings
SQL task
Result Set: Full result set
SQL Source: Direct Input
SQL Statement: Select Count (*) FROM X
Parameter Mapping
Variable Name: User::C
Direction: Return Value
Data Type: Numeric
Parameter Name: NewParameterName
Result Set = NewResultName: User::C
Precedence Constraint
Evaluation Operation: Expression and Constraint
Value: Success
Expression: @C > 0 ( I originally tried User::C and received an error message)
Execute SQL Server Agent Job
If step one results greater than 1, then execute the SQL agent job (SRS Report) Using this setup I receive an error message stating "
TITLE: Package Validation Error ------------------------------ Package Validation Error ------------------------------ ADDITIONAL INFORMATION: Error at Package: The expression "@C > 0" must evaluate to True or False. Change the expression to evaluate to a Boolean value. Error at Package: There was an error in the precedence constraint between "Execute SQL Task" and "Execute SQL Server Agent Job Task". (Microsoft.DataTransformationServices.VsIntegration)
Any thought or suggestions would be greatly appreciated.
I have an Execute SQL Task that may return a result set. If it returns a result set, I'd like to log a failure in my package with the results visible.
I have logging turned on and that's working great. I've read about assigning results to a user variable of type Object and that's great. I can shred my results, thanks Jamie, with a Foreach loop no problem. Within that loop, I've got some VB that manipulates the values and will call Dts.Events.FireError as appropriate. However, VB is frowned upon here so my boss has asked that I push the VB logic into a Control Flow item.
I've built custom components already so I've got some familiarity with the process. Where I'm stuck at is figuring out _what_ the actual object type is in my code. The Connection manager is Native OLE DBSQL Native client. My Execute SQL Task uses a connection type of OLE DB with a Full result set. Results are stored in a variable named ErrorResultSet. Within the Execute method, I currently have this code set up in an attempt to pick apart the object and discover the available methods.
// Iterate through the variables that we were // able to lock. Assigning values to entities as // available. foreach (Variable _en in _variableCollection) { switch (_en.Name) { case "ErrorResultSet": Object _rs = _en.Value; System.Type _type; _type = _rs.GetType(); System.Data.DataSet _realResults; _realResults = _rs as System.Data.DataSet; // My expectation is that the cast of _realResults would // not fail. break; } } // unlock before we go _variableCollection.Unlock(); return DTSExecResult.Success;
At this point, my assumption is that the unboxed type of the recordset is not in the System.Data.DataSet inheritance chain as the cast failed. Anyone have insight into what it is? I can't seem to get any hits on google for what it's using behind the scenes in the Foreach ADO Enumerator.
Beyond the immediate question, anyone have thoughts on how else I can solve the problem? I had thought perhaps the task could raise an event if it returned rows but it didn't seem to have that functionality. Even if that had worked, telling the logging provider to capture the result set into the log might have been too much for native functionality. Another option I was thinking about would be to continue using the Enumerator and my custom component is a pure rewrite of the current Script task with the obvious downside being that I'd lose the generic-ness I was hoping to get with being able to hit my dataset.
I wonder if you can help with the following requirement.
I want to be able to conditionally execute an 'execute process task' depending on the result of a query. I have a table which I will select one record/row from upon each execution, this record has a char 1 'type' field which is the indicator for what process to then execute.
This should be quite a simple package and will be run every 60 seconds so needs to be as efficient as possible.
I am thinking I should go along the lines of using an Execute SQL task to select my row in to a result set, and using a series of precedence expressions to determine what process to execute. But im not really sure how.....
I am a newbie to SSIS and 2005 in general so would appreciate any help you can provide
For our customer we are trying to create dynamically local cube files. Because the requirements are complex and we need to generate a lot of cube files, we can't use the MDX script CREATE GLOBA CUBE to create the local cubes and we have to use SSIS to have it done automatically. These are the steps we are following: 1. In a SSIS package, through a Script task, we generate the ASSL script in order to create the database and we stores the script in a column of the XML datatype in SQL Server through a stored procedure "SSAS_TEST.InsertASSLScript". The following code is use in the script task:
Code Block Imports System Imports System.IO Imports System.Data Imports System.Math Imports System.Xml Imports System.Data.SqlClient Imports Microsoft.SqlServer.Dts.Runtime Imports Microsoft.AnalysisServices Class ScriptMain 'Create writers and set formating for xml Dim myScripter As Scripter 'Represents a writer to write information to a string Dim myStringWriter As New System.IO.StringWriter() Dim myStringWriterTrans As New System.IO.StringWriter() 'Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations. Dim myXmlTextWriter As System.Xml.XmlTextWriter Dim myXmlTextWriterTrans As System.Xml.XmlTextWriter Dim myXmlWriterSettings As XmlWriterSettings Sub New() myScripter = New Scripter myXmlTextWriter = New System.Xml.XmlTextWriter(myStringWriter) myXmlTextWriterTrans = New System.Xml.XmlTextWriter(myStringWriterTrans) myXmlWriterSettings = New XmlWriterSettings myXmlWriterSettings.OmitXmlDeclaration = True myXmlWriterSettings.ConformanceLevel = ConformanceLevel.Auto myXmlTextWriter.Formatting = Formatting.Indented myXmlTextWriter.Indentation = 2 End Sub Public Sub Main() 'Get Server name from DTS connection object and store in variable Dim oDTSASConnection As ConnectionManager = Dts.Connections("SARP_Cubes") Dim sASServer As String = CStr(oDTSASConnection.Properties("ServerName").GetValue(oDTSASConnection)) 'MsgBox("Server " & sASServer & " has been connected") Dim oASServer As New Microsoft.AnalysisServices.Server 'Connect to the requested server oASServer.Connect(sASServer) 'Get Database name from DTS connection object and store in variable Dim sASDBName As String = CStr(oDTSASConnection.Properties("InitialCatalog").GetValue(oDTSASConnection)) Dim oASDatabase As New Microsoft.AnalysisServices.Database 'MsgBox("InitialCatalog " & sASDBName & " has been found") 'Get database sASDBName and store in variable oASDatabase = oASServer.Databases.GetByName(sASDBName) 'MsgBox("Database " & sASDBName & " has been connected") 'Get Cube Dim CubName As String If Dts.Variables.Contains("CubName") = True Then CubName = CType(Dts.Variables("CubName").Value, String) End If Dim oASCube As New Microsoft.AnalysisServices.Cube 'MsgBox("Database " & sASDBName & " has been connected") 'Create a variable to store the create cube ASSL-script 'Dim sASSLCreateCub As String 'Store the create script in myXmlTextWriter myScripter.ScriptCreate(New MajorObject() {oASDatabase}, myXmlTextWriter, False) myXmlTextWriter.Flush()
'Create a string in order to manipulate the XML-string and append the Batch and process element Dim sASSLString As String sASSLString = "" & myStringWriter.ToString & "ProcessFull SARP_Cubes"
'Make a database conenction through connection manager 'Get Server name from DTS connection object and store in variable Dim oDTSDBConnection As ConnectionManager = Dts.Connections("METADATA") Dim sDBServer As String = CStr(oDTSDBConnection.Properties("ServerName").GetValue(oDTSDBConnection)) Dim sDBDatabase As String = CStr(oDTSDBConnection.Properties("InitialCatalog").GetValue(oDTSDBConnection)) Dim oBuilder As New SqlConnectionStringBuilder() oBuilder.DataSource = sDBServer oBuilder.InitialCatalog = sDBDatabase oBuilder.ConnectTimeout = 1000 oBuilder.IntegratedSecurity = True oBuilder.ApplicationName = "InsertASSLScript" Dim oDBConnection As New SqlConnection(oBuilder.ConnectionString.ToString) ' Create Sql Command Dim cmd As New SqlCommand("SSAS_TEST.InsertASSLScript", oDBConnection) cmd.CommandTimeout = 60 cmd.Connection = oDBConnection cmd.CommandType = CommandType.StoredProcedure ' Add parameters and their values cmd.Parameters.Add(New SqlParameter("@COUNTRY_CODE", SqlDbType.VarChar, 255)).Value = "999" cmd.Parameters.Add(New SqlParameter("@CUBE_XMLA", SqlDbType.VarChar)).Value = sASSLString cmd.Parameters.Add(New SqlParameter("@DATABASE_ID", SqlDbType.VarChar, 255)).Value = sASDBName cmd.Parameters.Add(New SqlParameter("@CUBE_ID", SqlDbType.VarChar, 255)).Value = "ALL CUBES" ' Open the connection oDBConnection.Open() ' Execute the command cmd.ExecuteNonQuery() ' Clean Up myStringWriter.Close() myStringWriterTrans.Close() 'myStringReader.Close() 'myXMLReader.Close() myXmlTextWriter.Close() 'oDBConnection.Close() oASServer.Disconnect() Dts.TaskResult = Dts.Results.Success End Sub
End Class
2. We manipulate the ASSL-script in order to create the cube that we want to have as local cube
3. We extract the final ASSL-script from the database through an "Execute SQL Task" with a XML Result Set. The SQL use in the task is:
Code Block SELECT cast(CUBE_XMLA as varchar(max)) FROM SSAS_TEST.CUBE_XMLA WHERE (COUNTRY_CODE = '500')
I have also tried
Code Block SELECT CUBE_XMLA FROM SSAS_TEST.CUBE_XMLA WHERE (COUNTRY_CODE = '500')
and
Code Block SELECT CUBE_XMLA FROM SSAS_TEST.CUBE_XMLA WHERE (COUNTRY_CODE = '500') FOR XML AUTO
I always get the same error: "Execute SQL Task: Executing the query "SELECT cast(CUBE_XMLA as varchar(max))
FROM SSAS_TEST.CUBE_XMLA
WHERE (COUNTRY_CODE = '500') " failed with the following error: "/ROOT/*[local-name()="Batch" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="Create" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="ObjectDefinition" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="Database" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="Cubes" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="Cube" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="MeasureGroups" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="MeasureGroup" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]/*[local-name()="Source" and namespace-uri()="http://schemas.microsoft.com/analysisservices/2003/engine"][1]
Type '{http://schemas.microsoft.com/analysisservices/2003/engine}MeasureGroupBinding' is not found in Schema."
Does anyone know how to handle this?
If we could use this XML variable, we will use another Script task to generate our Local Cube(s). The script task looks like this:
Code Block Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports Microsoft.AnalysisServices.AdomdClient Imports System.Data.SqlClient Imports System.Xml Public Class ScriptMain ' The execution engine calls this method when the task executes. ' To access the object model, use the Dts object. Connections, variables, events, ' and logging features are available as static members of the Dts class. ' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure. ' ' To open Code and Text Editor Help, press F1. ' To open Object Browser, press Ctrl+Alt+J. Public Sub Main() 'Declare variables 'Connection Dim conn As AdomdConnection 'Command Dim cmd As AdomdCommand 'Cellset Dim cst As CellSet Dim strFilename As String = "D:TestLocal.cub" Dim strSource As String = Dts.Variables("ASSLCreateScript").Value.ToString() '*----------------------------------------------------------------------- '* Open connection. '*----------------------------------------------------------------------- Try ' Create a new AdomdConnection object, providing the connection ' string. conn = New AdomdConnection("Data Source=" & strFilename) ' Open the connection. conn.Open() Catch ex As Exception Throw New ApplicationException( _ "An error occurred while connecting.") End Try Try '*----------------------------------------------------------------------- '* Open cellset. '*----------------------------------------------------------------------- ' Create a new AdomdCommand object, providing the ASSL query string. cmd = New AdomdCommand(strSource, conn) ' Run the command and return a CellSet object. cst = cmd.ExecuteCellSet() '*----------------------------------------------------------------------- '* Release resources. '*----------------------------------------------------------------------- conn.Close() Catch ex As Exception ' Ignore or handle errors. Finally cst = Nothing cmd = Nothing conn = Nothing End Try Dts.TaskResult = Dts.Results.Success End Sub End Class
I hope that someone can help us. We browse the net without result,
I have a 'Execute SQL Task' in my 'control flow', my 'Execute SQL Task' will return a value which I am assigning to a variable. Based on the value of the variable, I need to control my other flows. If the variable's value is 1 then I should invoke a dataflow, else I should write a failure error message in event viewer. Please could someone provide some inputs on how this can be done.
'Execute SQL Task' ----->value 1 ------>data flow to be executed
'Execute SQL Task' ----->value !=1 ------> write some error message in the event viewer and no tasks should be executed after that.
Is there anyone who was able to successfully retrieve a full result set? I'm really having troubles getting the result after executing my query. Its really even hard to get sample codes over the net.
I am trying to have an Excecute SQL Task return a single row result set executed on SQL Server 2005.
The query in the Execute SQL Task is: select 735.234, 2454.123
I get a conversion error when trying to assign to SSIS variables of type Double. I have nothing configured in the "Parameter Mapping" tab. I have the two SSIS Double variables mapped to the Tesult Name 0 and 1 in the "Result Set" tab
I don't want to use a for loop enumerator since there is a single row returned.
I simply want to assign these two values to SSIS Double variables (double is the closest match)
I can't even hack this by converting the decimals as string and then using DirectCast to convert them to Double.
I had got the below error when I execute a DELETE SQL query in SSIS Execute SQL Task :
Error: 0xC002F210 at DelAFKO, Execute SQL Task: Executing the query "DELETE FROM [CQMS_SAP].[dbo].[AFKO]" failed with the following error: "The transaction log for database 'CQMS_SAP' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
But my disk has large as more than 6 GB space, and I query the log_reuse_wait_desc column in sys.databases which return value as "NOTHING".
So this confused me, any one has any experience on this?
im very new to SSIS package .my package consists of Single Exceute task.
In Single Exceute SQL task i had 3 seperate queries to get the count of rows of 3 tables.
the Query goes like dis ...
select count(*) AS precheckcount1 from new_main_dts where cust_nbr like '875%'
like dis for another 2 tables i had written with the alias name precheckcount2 and 3
i mapped the variable user::precheckcount1 to precheckcount1 in the resultSet and for other two alias name i did the same.
while executing the package the error is thrown : [Execute SQL Task] Error: An error occurred while assigning a value to variable "precheckcount2": "Unable to find column precheckcount2 in the result set.".
I have an Execute SQL Task (OLE DB Connnection Manager) with a SQL script in it. In this script I use several SQL variables (@my_variable). I would like to assign an IS variable ([User::My_Variable]) to one of my SQL variables on this script. Example:
DECLARE @my_variable int
, <several_others>
SET @my_variable = ?
<do_some_stuff>
Of course, I also set up the parameter mapping.
However, it seems this is not possible. Assigning a variable using a ? only seems to work in simple T-SQL statements.
I have several reasons for wanting to do this:
- the script uses several variables, several times. Not all SQL variables are assigned via IS variables.
- For reading and mainenance purposes, I prefer to pass the variable only once. Otherwise every time the script changes u need to keep track of all questionmarks and their order.
- Passing the variable once also makes it easier to design the script outside IS using Management Studio.
- This script only does preparation for the actual ETL, so I prefer to keep it in one task instead of taking it apart to several consecutive Execute SQL Tasks.
- I prefer to use the OLE DB connection manager because it's a de facto standard here.
Could anyone help me out with the following questions:
- Is the above possible?
- If so, how?
- If not, why not?
- If not, what would be the best way around this problem?
This is the first time I've tried creating an "execute sql task" with a "full result set".
I've read in the documentation that I must set the resultname to 0, which is done, and that the variable must be of type object. Also done.
[Execute SQL Task] Error: Executing the query "select * from blah" failed with the following error: "The SelectCommand property has not been initialized before calling 'Fill'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Has anyone else had success with a full result set?
I have a variable SYear with the data type Integer and the value 2005.
Connection type is OLE DB, and my sql statement is:
DECLARE @MyYear Int
SET @MyYear = ?
I have set the variable User::Syear as Input with the parameter name=0, there is no result set. I set BypassPrepare both True and False. However, this simple statement does not work. I keep having an error. If I put integer value directly into @MyYear, it is fine. What is wrong in here? Somebody help me!
I need help with some C# code. I have build a SSIS package with an Execute Process Task. I need to send dynamic variables in to my C# program so I thought it was a good idea to use the StandardInputVariable.
I'm working on an SSIS package that uses a vb.net script to grab some XML from a webservice (I'd explain why I'm not using a web service task here, but I'd just get angry), and I wish to then assign the XML string to a package variable which then gets sent along to a DataFlow Task that contains an XML Source that points at said variable. when I copy the XML string into the variable value in the script, if do a quickwatch on the variable (as in Dts.Variable("MyXML").value) it looks as though the new value has been copied to the variable, but when I step out of that task and look at the package explorer the variable is its original value.
I think the problem is that the dataflow XML source has a lock on the variable and so the script task isn't affecting it. Does anyone have any experience with this kind of problem, or know a workaround?
I have a SQL Task that updates running totals on a record inserted using a Data Flow Task. The package runs without error, but the actual row does not calculate the running totals. I suspect that the inserted record is not committed until the package completes and the SQL Task is seeing the previous record as the current. Here is the code in the SQL Task:
DECLARE @DV INT; SET @DV = (SELECT MAX(DateValue) FROM tblTG); DECLARE @PV INT; SET @PV = @DV - 1;
I've not been successful in passing a SSIS global variable to a declared parameter, but is it possible to do this:
DECLARE @DV INT; SET @DV = ?; DECLARE @PV INT; SET @PV = @DV - 1;
I have almost 50 references to these parameters in the query so a substitution would be helpful.
How to define a Input variable in a Execute Sql Task?? I've defined a User::Inicio variable which contains 4 as value.
In Parameter Mappins it has been defined. Then, I've gone to General->Sql Statement and allocated the following SQL Statement: UPDATE CARGAPROCESOS SET FECHAULTIMACARGA = [Inicio] or UPDATE CARGAPROCESOS SET FECHAULTIMACARGA = [User::Inicio]
Anyway, I'm stuck, both did not work Thanks in advance for your comments