Strange Execute Sql Task Issue
Sep 6, 2007
I have a stored procedure open an remote Excel files (\remotec$direxcelfile.xls) using openrowset. It runs well in Management Studio.
However, it always failed if I run the stored procedure in an Execute SQL Task of a SSIS package on another PC.
They all use Windows Integration Security. And I inserted SQL "select system_user" and in both cases it returns my Windows Logon.
Any clue? TIA
View 7 Replies
ADVERTISEMENT
Jun 21, 2007
OK. I give up and need help. Hopefully it's something minor ...
I have a dataflow which returns email addresses to a recordset.
I pass this recordset into a ForEachLoop configuring the enumerator as (Foreach ADO Enumerator). I also map the email address as a variable with index 0.
I then have a Execute SQL task which receives this email address as a varchar variable (parameter 0) which I then use in my SQL command to limit the rows returned. I have commented out the where clause and returned all rows regardless of email address to try to troubleshoot this problem. In either event, I then use a resultset to store the query result of type object and result name 0.
I then pass this resultset into a script variable to start parsing the sql rows returned as type object. ( I assume this is the correct way to do this from other prior posts ...).
The script appears to throw an exception at the following line. I assume it's because I'm either not passing in the values properly or the query doesn't return anything. However, I am certain the query works as it executes just fine at the command prompt.
Try
ds = CType(Dts.Variables("VP_EMAIL_RESULTS_RS").Value, DataSet)
My intent is to email the query results to each email address with the following type of data by passing the parsed data from the script to a send mail task. Email works fine and sends out messages but the content is empty. I pass the parsed data as string values to the messagesource and define the messagesourcetype as a variable in the mail task.
part number leadtime
x 5
y 9
....
Does anyone have any idea what I might be doing wrong?
thanks
John
View 5 Replies
View Related
Dec 6, 2006
Dear all:
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?
Many thanks,
Tomorrow
View 5 Replies
View Related
Apr 19, 2007
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.
View 5 Replies
View Related
Jul 1, 2015
I'm using SSIS in Visual Studio 2012. My Execute SQL Task calls a Stored Procedure where I have a TRY-CATCH. Last week there was a problem and the CATCH was executed and logged an error to my error table, but for some reason the Execute SQL Task didn't fail. Is there a setting to make the Execute SQL Task fail when an SP encounters a failure?
View 3 Replies
View Related
Mar 12, 2008
I am using SQL 2005 SSIS. I am joining several large tables and then the move result into another table in the same database.
I would like know which method is faster:
Use Execute SQL Task to insert the result set to the target table
Use the Data Flow Task to insert the result set to the target table. (Use OLE DB source to execute SQL command and then use the SQL destination)
Could you tell me why then other is slower?
Thanks.
View 7 Replies
View Related
Dec 2, 2005
I have a SQL Task that calls a stored procedure and returns an output parameter. The task fails with error "Value does not fall within the expected range." The Stored Procedure is defined as follows: Create Procedure [dbo].[TestOutputParms] @InParm INT , @OutParm INT OUTPUT as Set @OutParm = @InParm + 5 The task uses an OLEDB connection and has a source type of Direct Input. The SQL Statement is Exec TestOutputParms 7, ? output The parameter mapping is: Variable Name Direction Data Type Parameter Name User::OutParm Output LONG @OutParm
View 7 Replies
View Related
Mar 28, 2007
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
oLogFile.WriteAllText("C:MyFile.txt", strValue)
oLogFile.WriteAllText("C:MyFile.txt", rsSQLOutput)
I went through this link that explains how to write XML Result Set into a File, But this doesn't help as it writes in XML format.
Would you please give me a hint of code how I can go upon.
View 7 Replies
View Related
Jun 14, 2006
Hi
I have an application like fetching records from the DataBase(MS Access 2000) and results i have to use in Script Task. At present i have used the record fetching query,connection string in Script itself. I would like to use in Independently. Is there any Tools like (Control Flow Tools like Execute SQL Task) are there to fetch the result set from Acccess and can use the fetching results in Script Task....
Thanks & Regards
Deepu M.I
View 5 Replies
View Related
Jun 25, 2007
I have a SSIS package contains an "Execute SQL Task". The SQL will raise error or succeed. However, it sounds the package won't pick up the raised error?
Or is it possible to conditional run other control flow items according the the status of SQL task execution?
View 1 Replies
View Related
Sep 21, 2006
Hi everyone,
For first time I'm testing this task and surprisingly, when I try "Edit Package" option:
1)The DTS host failed to load or save the package properly
2)The selected package cannot be opened
3)Error HRESULT E_FAIL has been returned from a call to a COM component
But after these messages you can see all the tasks but they haven't name!!
It seem as if RCW mechanism has failed between managed and unmanaged coded-partially.
I don't dare to follow doing more stuff, I don't know if that package is well-loaded or not from there. ?¿
Any guidance or idea about this?
View 5 Replies
View Related
Jun 12, 2007
An Execute SQL task takes 1 min to run a statement "insert into Mytable select * from view_using_joins"
Output: 10,225 rows affected.
But a Dataflow task configured to fetch data from the same view_using_joins into MyTable takes hours to do the same.
Could you please explain why is it so ?
Thanks
Subhash Subramanyam
View 14 Replies
View Related
Apr 13, 2007
Hi everyone,
Primary platform is XP Pro Sp2. Sql25k sp1.
I€™ve got a ForEach container which uses a Foreach ADO Enumerator.
Inside which I have several sql tasks and one Script Task.
Once I launch debugger engine going to VSA and on the right side I see six references to ScriptTask
ScripTask_xnxnxnxnxnxnxnxnxnx
..
..
..
After that, appears this error:
Sql Server Script Task has detected an error and it should be closed€¦
Once there you can start just-in-time debugger:
System.Runtime.InteropServices.COMException was unhandled
Message: File position not valid for new breakpoint.
In a fact, I can follow debugging the execution but I€™m concerned about this behaviour in production environment.
PrecompilescriptintoBinaryCode is false. How odd, I€™ve done other scripts and never happened something like that.
Thanks in advance and regards,
View 7 Replies
View Related
Jan 28, 2008
Hi,
I have a strange problem scheduling SSIS package in SQL Server Agent.
An SSIS package which uses FTP to download a file from an FTP Server is scheduled through the SQL Server Agent to run every hour to look for the file and download it if exists.
- Iam using an Agent proxy which has all the necessary permissions to run the package.
- The package is protected as "EncryptsensitivewithUserKey".
It runs fine in schedule sometimes, ie it downloads the file and processes it alright.
But sometimes, very strangely , for an extended period while in schedule, it gives up an error saying -
- Unable to connect to FTP server using "Click_FTP_Location".
Click_FTP_Location - is the FTP connection manager used in the package.
Has anyone experienced this in any of their work??
We are also trying to see if there is something wrong with the FTP server itself.
Any comments/suggestions appreciated.
Thanks
View 5 Replies
View Related
Sep 21, 2006
Hi everyone,
Our VB application throws .dtsx on-demand by using Threads. Everything's fine but a little detail:
when it goes to launch a SSIS package with a only task, concretely a Sequence Container task (empty, without tasks inside) fails Prevalidate method.
Attach you the snippet of code:
pkgResults = pkg.Validate(Nothing, Nothing, EventsSSIS, Nothing) -- pkgResults returns me Failure {1}
If pkgResults = DTSExecResult.Success Then
..
..
Validate method, as usual, do EVENTSSSIS.PreValidate event and after that, returns instead of follow raising events.
Perhaps it's mandatory to set one task as a minimum, I don't get the point at all
Any guidance or thought will be welcomed,
Thanks in advance and regards,
View 5 Replies
View Related
Mar 19, 2008
Hi there,
Eversince I've moved my import packages to our new dev server, I have been experiencing strange behaviour in my packages that does the archiving of the .csv files which we import.
These 'Archive' packages doesn't do anything fancy in my opinion and most of them work. To explain how the logic works:
The package consists of a For Each Loop that picks up the file, passes it to a string variable. Inside the For Each Loop container, I have 2 File system tasks. 1 Renames the file and then flows out to another that moves it (I am aware of the fact that I can do the rename and move in 1 go but prefered to keep it separate).
The FST that does the renaming, gets its source from the For Each Loop and after renaming the file, the file's new fully qualified path is stored in another variable. This variable then gets to be the source of the FST that moves it to the desired location...like i said...nothing fancy
I am getting errors where it tells me there is a mistake on my Rename FST's expresssion, which is nonsense since I run it on exactly the same files on my machine without problems. Another error is even more baffling...I get the Moving FST erroring out and complaining about not finding the renamed file?? how can this be?? it works also on my local machine, I wonder if it sometimes doesn't pass the variables correctly??
I recently got to install SQL service pack 2 on the box, which improved some things but these packages have been copied over from another server which had service pack 2 on. There are also quite a bit of updates that this server should be running and I was wondering whether these might solve the instability I get?
Any advice/opinions welcome
Michael
View 4 Replies
View Related
Jan 8, 2007
Hi All,
I've been doing some further testing on SSIS and come across what I consider strange behaviour of the FileSystemTask.
This is set to delete a file, using the file name input from a variable.
If the file doesn't exists I would expect the task to fail, but instead it does not. It succeeds ! I would expect this to fail if the file it attempts to delete is not found.
Can anyone duplicate this strange behaviour ?
Regards,
P R W.
View 6 Replies
View Related
Jan 25, 2007
I am trying to execute a SP in the execute SQL task in SSIS 2005..
but I keep getting an error:
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Load_Gs_Modifier_1, Execute SQL Task: Executing the query "exec Load_GS_Modifier_1 ?, ?" failed with the following error: "Could not find stored procedure 'exec Load_GS_Modifier_1 ?, ?'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Load_Gs_Modifier_1
SSIS package "Package.dtsx" finis
I have set up two user parameters: startdate and enddate.. I am not sure what I am doing wrong????
View 3 Replies
View Related
Jan 23, 2007
Phil writes "I have a simple question. My scenerio is that I would like to read a column from a table in a SQL database in the Execute SQL Task in SSIS. I would like to assign the value of that column (which is a nvarchar(50) column) to a variable.
The issue I'm having is that unless I make the variable's data type an "object" I am getting the:
"The type of the value being assigned to variable "User::output_location" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object."
error.
I've checked profiler and verified the call is getting to the database. Why can't I populate a nvarchar column to a string data type variable?
Thanks,
Phil"
View 3 Replies
View Related
Mar 17, 2007
hi
I have created an Execute SQL Task package and save as package.dtsx
using northwind database
In this package, i have a sql statement: Select * into tblTest from dbo.Orders where OrderID >= ? and OrderID <= ?
I have created 2 package level variables which is OrderID1 and OrderID2, both are Int32 and Value = 0.
I have also used parameter mapping: user:OrderID1,Input, Long, 0, -1
user:OrderID2,Input, Long, 0, -1
I have created a proc to test:
Create Proc spTest
@Value1 int,
@Value2 int
as
Declare @cmd varchar(1000)
set @cmd = 'dtexec /FILE "C:Package.dtsx" /SET Package.Variables[OrderID1].Value;@Value1 /SET Package.Variables[OrderID2].Value;@Value2'
exec master..xp_cmdshell @cmd
When I execute spTest 10249,11029, it gave me "it could set Package.variables[OrderID1].value;@Value1 and so on.
I hope someone could help me with this. Thanks
View 1 Replies
View Related
Jun 13, 2007
Hey all
I have created an SQL Task with the following as SQL Statement Source expression:
"INSERT INTO SSISLog (EventDate,StaffNo, EventType, EventDescription)
VALUES (
'@[System::CreationDate]+',
' +@[System::SourceName]+' ,
'OnError',
'+ @[System::ErrorDescription] +'
)
"
And I get the following error:
[Execute SQL Task] Error: Executing the query "INSERT INTO SSISLog (EventDate,StaffNo, EventType, EventDescription) VALUES ( '@[System::CreationDate]+', ' +@[System::SourceName]+' , 'OnError', '+ @[System::ErrorDescription] +' ) " failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Any pointers will be highly appreciated. Oh and the purpose of this is to put error logs into the SSISLog table.
Many thanks
Rupa
View 12 Replies
View Related
Mar 21, 2006
I am trying to run a Direct Input SQL query to SELECT MAX value of ColA. This query when I run on Query Window runs fine - means it is NOT a NULL. I get a max value.
When I run this query on a SSIS package outputing to a variable - I get the error. -
[Execute SQL Task] Error: An error occurred while assigning a value to variable "MAXROWKEYID": "The type of the value being assigned to variable "User::MAXROWKEYID" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. ".
I need this output to be used for the subsequent steps which follows this.
I am using Value Type as Double. This was the default when I migrated this DTS package from SQL 2000. I use the proper Single Row for the Result Set and for outputing the Result Set, I use the correct Variable Name.
Help will be greatly appreciated...
Thanks.
SAM.
View 5 Replies
View Related
Oct 3, 2006
In SSIS Control Flow, I a have an Execute SQL Task that populates a result set with data.
How can I make that same data accessible to my data flow - so that I can export the data to a flat file?
Thank you
View 1 Replies
View Related
Aug 3, 2007
I execute a sql task to get full resultset. How do i stop processing (With Package success) the package (With Package success) if the resultset returned is empty? Their does not seem to be any swith or expression to stop processing if i dont get any results.
View 6 Replies
View Related
Apr 10, 2008
In the sqlstatement for Execute SQL Task, I want to specify a sql statement (if (select count(*) from table1 > 0) then execute next task, which is send mail task.
how do i achieve this? , how can I specify a conditional statement and execute the next task based on the result?
Thanks in advance.
View 5 Replies
View Related
Oct 22, 2007
Hi,
can anyone tell me how to create multiple tables using execute sql task.
i am getting error messages when i try to execute.
I am using OLE DB Connection type.
and i am running Execute sql task insede the Foreach looop container.
Error messgae is:
[Execute SQL Task] Error: An error occurred with the following error message: "Access to the path 'C:Documents and SettingsAdministratorDesktopCreateTableSQLStatements' is denied.".
Thanks and regards,
Sheetal
sheetal_net@hotmail.com
View 6 Replies
View Related
Jun 29, 2007
I want to perform following using Execute SQL task
declare @LogID int, @OperationID int
exec usp_CreateLog
@DataProvider='ABC'
,@Source_Original = ''
,@NoTables = 3
,@UserName = '@userName'
,@LogID =@LogID output
select @LogID as LogID
I want @LogID as output. Please suggest how to achive in SSIS
View 8 Replies
View Related
Aug 30, 2007
in my control flow items toolbox. Anyone know of how I can get it installed?
View 8 Replies
View Related
Nov 6, 2006
Hi
how would you use a package variable in inline sql, is there a format utilized? Are there any steps I need to take to do that? I currently have the SQL Execute task inside a ForEach Loop container, which has the variable mapping for the ID that i need for the SQL Execute task. I just need to know the syntax to use parameters in my query in my task. here is the current code which doesnt work:
INSERT INTO LAFProcess.ProcessList (WorkListID, CreatedOn, ProcessStartedOn, Status)
SELECT WorkListID, GetDate(), NULL, 2
FROM LAFProcess.WorkList
WHERE Status = 2 AND LoanApplicationID = " + @[User::LoanApplicationID] +"
UPDATE LAFProcess.WorkList
SET Status = 1
WHERE LoanApplicationID = " + @[User::LoanApplicationID] +"
AND Status = 2
Note: Do i have to setup anything in the parameter mapping or result set for this execute sql task or for the for loop container around it because right now nothing is setup for Execute SQL Task. Pls let me know. The for loop container is connected to a another sql execute task which is resulting in a fullResultset, which the for loop container loops thru(ADO Enumerator). But also need to pull a value(basicaly setup a variable but dont know where). I am really confused can someone please help me. The loan application id is what i want in my query and it should come from the Collection(ForEachLoop). I am supposed to run the above task for each (LoanApplicationID found in my collection).Thanks.
Pls let me know. thanks
View 30 Replies
View Related
Mar 6, 2007
Hi
I have a Sql execute task, which has a select query which returns back a column value(always one value). I need to store that into a user variable. Do i add a resultset type, and if so which one? Also do i add a new parameter in the param mapping window, with direction of output? Please let me know, since I need to store the resultset value to a user variable. Thanks.
View 5 Replies
View Related
Mar 16, 2007
I am using many Execute Package Tasks in a DTS packages to call a number of other DTS packages. The problem is that when I change one of the called DTS packages the execute package task does not run the updated packages. It looks like the execute package task references a Package ID guid instead of the name. Is there a way to make it so a change to a called DTS package will reflect in all references to it
View 2 Replies
View Related
Apr 1, 2005
I have a DTS that takes text files that one of my programs creates and imports the information into excel files. Each of our company's sites has a separate set of text files and excel file. Sometimes though users want to get the information just for their site, so is there a way to execute only specific DTS package steps programmatically from ASP.NET or the DTSRUN utility?
Thanks,Adam
View 2 Replies
View Related
Nov 15, 2004
Hi all !
Hi have a package with 3 steps :
1 - import data from flat file into a temp table
2 - copy selected data from the temp table to permanent tables
3 - truncate temp table
The task #2 is a SQL statement
INSERT INTO MODELS (MODEL_ID)
SELECT DISTINCT MATNR
FROM STANDARD
WHERE MATNR NOT IN (SELECT MODEL_ID FROM MODELS)
where STANDARD is the temp table and MODELS a permanent one. My problem is this simple task freezes all the time. It stalls on 'Starting' and stays in this state forever when I execute the package.
Any idea why ?
View 3 Replies
View Related