How To Precompile A Script Task Through The API?
Nov 27, 2007
I've been working on adding "copy a script task from one package to another package" functionality to my SSIS Package Manager (PacMan - http://www.codeplex.com/pacman) utility in order to ease some of the pain I'm feeling in my main SSIS dev project these days. The code I have today looks something like this:
Code Block
public void CopyScriptTaskPrototype(PackageUtil sourcePackage)
{
// Basic logic taken from https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=941508&SiteID=1
const string CODE_MONIKER_TEMPLATE = "dts://Scripts/{0}/ScriptMain.vsaitem";
const string PROJ_MONIKER_TEMPLATE = "dts://Scripts/{0}/{0}.vsaproj";
const string BINN_MONIKER_TEMPLATE = "dts://Scripts/{0}/{0}.dll";
try
{
// Get the source task
TaskHost sourceScriptTaskHost = sourcePackage.ssisPackage.EventHandlers["OnPreExecute"].Executables[0] as TaskHost;
ScriptTask sourceScriptTask = sourceScriptTaskHost.InnerObject as ScriptTask;
// Get the target container
if (!this.ssisPackage.EventHandlers.Contains("OnPreExecute"))
{
this.ssisPackage.EventHandlers.Add("OnPreExecute");
}
DtsEventHandler targetContainer = this.ssisPackage.EventHandlers["OnPreExecute"];
// Delete the target task, if it exists
if (targetContainer.Executables.Contains(sourceScriptTaskHost.Name))
{
targetContainer.Executables.Remove(sourceScriptTaskHost.Name);
}
TaskHost targetScriptTaskHost = targetContainer.Executables.Add("STOCK:SCRIPTTASK") as TaskHost;
targetScriptTaskHost.Name = sourceScriptTaskHost.Name;
targetScriptTaskHost.Description = sourceScriptTaskHost.Description;
ScriptTask targetScriptTask = targetScriptTaskHost.InnerObject as ScriptTask;
targetScriptTask.SetUniqueVsaProjectName();
string sourceCodeMoniker = string.Format(CODE_MONIKER_TEMPLATE, sourceScriptTask.VsaProjectName);
string targetCodeMoniker = string.Format(CODE_MONIKER_TEMPLATE, targetScriptTask.VsaProjectName);
string sourceProjectMoniker = string.Format(PROJ_MONIKER_TEMPLATE, sourceScriptTask.VsaProjectName);
string targetProjectMoniker = string.Format(PROJ_MONIKER_TEMPLATE, targetScriptTask.VsaProjectName);
string sourceBinaryMoniker = string.Format(BINN_MONIKER_TEMPLATE, sourceScriptTask.VsaProjectName);
string targetBinaryMoniker = string.Format(BINN_MONIKER_TEMPLATE, targetScriptTask.VsaProjectName);
targetScriptTask.CodeProvider.PutSourceCode(targetCodeMoniker,
sourceScriptTask.CodeProvider.GetSourceCode(sourceCodeMoniker));
targetScriptTask.CodeProvider.PutSourceCode(targetProjectMoniker,
sourceScriptTask.CodeProvider.GetSourceCode(sourceProjectMoniker));
// We've commented this out due to errors at package runtime
//targetScriptTask.CodeProvider.PutBinaryCode(targetBinaryMoniker,
// sourceScriptTask.CodeProvider.GetBinaryCode(sourceBinaryMoniker));
targetScriptTask.PreCompile = false; // We want to be able to say "true" here
}
catch (Exception ex)
{
throw new ApplicationException("Could not copy script task - oh no!", ex);
}
}
This method exists within a PackageUtil class that has a private member variable named ssisPackage of type Microsoft.SqlServer.Dts.Runtime.Package, and for my current purposes I only need to worry about copying the first task from the OnPreExecute event handler for the package, so some things are hard-coded now that won't be later on.
Now, with that said, here is the question: How, through the .NET API can I force the Script Task code to be compiled so that I can set the PreCompile flag to true and have it work as if I'd done the work through VSA in the designer.
Thanks in advance to anyone who can help out here. This is "icing on the cake" to some extent, as the core functionality I need is currently in place, but it would be excellent to have this 100% complete.
View 14 Replies
ADVERTISEMENT
May 11, 2006
I have code which generates packages programatically, and script task is a part of the control flow. I've succeded to set source code programatically, but I do not know how to put binary code, because I need to have my script task precompiled.
Just setting PreCompile = true does not solve this problem
Thanks in advance.
Borko
View 1 Replies
View Related
Aug 24, 2006
I have a script task that I've created that just displays a MsgBox as listed in Professional SQL Server 2005 Integration Services in chapter 4. The problem is that when I exit the VSA design tool there is a red "X" on the task that says in a popup:
"The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE..."
I go back into the script design, and the code is there, and the PreCompile propterty IS set to True. Attempting to EXECUTE the task only results in a similar error, just more verbose without actually giving any additional insight.
I've read the thread on where the VSA code is deleted on closing.. but my code is still there.. it just isn't seeing the binary code (if it actually exists).
Ideas, comments or snide remarks anyone?
- Mark
View 10 Replies
View Related
Feb 9, 2006
Hi,
with a script task I get an error "This task is configured to pre-compile the script but the binary code is not found. Please visit the IDE in Script Task editor by clicking Desing Script button to cause binary code to be generated".
Well, if I do so the error doesn't disappear. The only chance I have is to switch of precopilation, which is quite a performance issue...
I have no idea where this error is comming from... The script is quite easy, just some string and file operations (find out file change date using system.io)...
Any idea?
View 8 Replies
View Related
Oct 6, 2006
I am pulling info out of MSDB to report on job schedules. As we have a mixture of 2005 and 2000 servers, I am varying my select statement according to the result of
[Code]
Set @Version = SubString(Convert(VarChar(10), (Select ServerProperty('ProductVersion'))),1,1)
[/Code]
I have to vary the tables for each condition. Not a problem,
[Code]
if @Version = 9
begin
Select whatever from table1 join table2
end
Else
begin
Select whatever from table1 join table3
end
Problem is that SQL 2005 is trying to verify the existence of the fields in the tables on compile (it knows that the table, for example, sysjobschedules exists in 2005, but the field "Name" doesn't - although it does in 2000) , even after the if statement checking if the version is 8, and SQL 2000 uses 2 tables whilst 2005 needs 3, and the fields I need are on one table in 2000, but in a different table in 2005.
SQL 2000 is fine with it - it just does it.
Syntax checking is fine.
Just to clarify, here is my code:
[Code]
Declare @Version Char(1), @CurrentDate datetime
Set @CurrentDate = GetDate()
Create Table #TempSchedDetails
( Server VarChar(30)
,CurrentDate VarChar(19)
,JobName VarChar(80)
,ScheduleName VarChar(80)
,Freq_Type Char(1)
,Freq_Interval VarChar(2)
,JobEnabled Bit
,Freq_Subday_Type VarChar(25)
,ScheduleEnabled Bit
,StartTime VarChar(25)
,EndTime VarChar(25)
)
Set @Version = SubString(Convert(VarChar(10), (Select ServerProperty('ProductVersion'))),1,1)
If @Version = '9'
Begin
Insert Into #TempSchedDetails
Select left(@@SERVERNAME,30)
,GetDate()--@CurrentDate
,J.Name
,SS.Name
,SS.Freq_Type
,SS.Freq_Interval
,J.Enabled
,SS.Freq_SubDay_Type
,SS.Enabled
,SS.Active_Start_Time
,SS.Active_End_Time
From msdb..SysJobs J
Left Outer Join msdb..SysJobSchedules JS on J.Job_Id = JS.Job_Id
Join msdb.dbo.SysSchedules SS ON JS.schedule_id = SS.Schedule_Id
Order By J.Name, Active_Start_Time
End
Else
Begin
Insert Into #TempSchedDetails
Select left(@@SERVERNAME,30)
,@CurrentDate
,J.Name
,S.Name
,S.Freq_Type
,S.Freq_Interval
,J.Enabled
,S.Freq_SubDay_Type
,S.Enabled
,S.Active_Start_Time
,S.Active_End_Time
From MSDB..SysJobs J
Left Outer Join MSDB..SysJobSchedules S On J.Job_Id = S.Job_Id
Order by J.name, Active_Start_Time
End
[/Code]
Any ideas as to how to turn the precompile checking off in 2005?
View 3 Replies
View Related
Nov 9, 2007
I have installed the Report Execution Sample reports and with it came the RSExecutionLog_Update.dtsx and instructions to enable it in a SQL Agent job. I have followed the instructions, however, where do I set the PreCompile property to false? Is there a way to pull in a dtsx file into BIDS?
View 7 Replies
View Related
Jun 8, 2007
Hi,
I'm working on a new site with a big number of future concurrent visitors so performance is very important. We're working on a search function with which users can search for multiple keywords in a single table. My .NET application consults a SQL Server 2005 Stored Procedure to lookup the information. The stored procedure builds up a dynamic SQL string with which the table is queried.
An example:
User searches for 'car airco'. Alle records with the words car and/or airco in specified columns should show up. This works. The query would be
SELECT Col1, Col2 FROM Table1 WHERE (Col1 LIKE '%car%' OR Col2 LIKE '%car%')OR (Col1 LIKE '%airco%' OR Col2 LIKE '%airco%')
As I mentioned before performance is a hot issue in this project. The problem with the stored procedure is that it can't be precompiled by SQL Server (dynamic SQL string). Is there a way to search for multiple keywords without losing the precompile behaviour of SQL Server Stored Procedures?
Kind regards,
ThaYoung1!
View 11 Replies
View Related
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
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
May 4, 2006
Hi,
I am trying to create a simple BI Application for SSIS. In Visual Studio 2005 I just get a Data Flow Task from the toolbar and add it to the project. When I double click it I get the following error:
The task with the name "Data Flow Task" and the creation name "DTS.Pipeline.1" is not registered for use on this computer.
Then when I try to delete it it gives this other error:
Cannot remove the specified item because it was not found in the specified Collection.
I am creating this application in an administrator account in this computer, so I doubt the problem is related to permissions. I am running SQL Server 2005 and Visual Studio 2005 in WinXP Tablet PC Edition.
Any suggestions why this is happening and how to fix it?
View 17 Replies
View Related
Feb 21, 2008
I am using the "Transfer SQL Server Objects Task" to copy some tables from database A to database B including data.
The tables, primary key constraints, Foreign key, data and all transfers nicely except for "DEFAULT CONSTRAINTS" on the tables.
I have failed to find any option in the "Transfer SQL Server Objects Task" task to explicitly say "copy default constraints". So I guess logically it should happen automatically but it doesn't. I hope it is not a bug :-)
Any option anyone knows will help.
Thanks.
View 17 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
Feb 1, 2007
In short, does the €œTransfer SQL Server Objects Task€? support distributed transactions?
In trying to use a €œTransfer SQL Server Objects Task€? in a container using a transaction on the container. The task is set to support the transaction. It is setup to copy table data from several tables from a non-domain server (sql server 2000) to a domain-based server (sql server 2005). I get an error stating, €œThis task can not participate in a transaction€?.
I am wondering if it means exactly what it says €“ this task in SSIS can€™t participate at all. Or does it mean that it won€™t in this scenario for some reason. I attempted a simple copy of data from mssql 2005 to mssql 2005 (same server) and the task still failed). MSDTC appears to be running properly on my machine and such (I can do a simple distributed transaction across linked server to the 2000 server in Query Analyzer (QA)). Also, MSDTC appears to be working on both servers with distributed transaction query tests in QA.
Here€™s the error info€¦
SSIS package "Development BusinessContacts and Products Migration.dtsx" starting.
Information: 0x4001100A at Copy BusinessContacts Data: Starting distributed transaction for this container.
Error: 0xC002F319 at Copy BusinessContacts database table data 1, Transfer SQL Server Objects Task: This task can not participate in a transaction.
Task failed: Copy BusinessContacts database table data 1
Information: 0x4001100C at Copy BusinessContacts database table data 1: Aborting the current distributed transaction.
Information: 0x4001100C at Copy BusinessContacts Data: Aborting the current distributed transaction.
SSIS package "Development BusinessContacts and Products Migration.dtsx" finished: Failure.
The program '[4700] Development BusinessContacts and Products Migration.dtsx: DTS' has exited with code 0 (0x0).
View 9 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
Oct 2, 2007
I have a stored procedure that is executed via a sql script task that returns a full result set. I map this result set to a variable or object type. Is there a way to use this variable as a data source in a subsequent data flow task?
A.
View 14 Replies
View Related
Mar 6, 2006
I have made one package which extracts data from the source does transformation and submits the data to destination. Subsequently it also updates the required control files.
Now I want to add a functionality :
If the package is executed again it should check the status of previous execution in control file if success mark all tasks disable and stop
if failure mark all tasks at enable and start extracting data and continue further with execution.
I was able to attain similar functionality in SQL Server 2000 using activeX script. What code do I need to write as a part of Script Task in order to attain above functionality.
View 3 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
Mar 7, 2007
1 :Control Flow Excute SQL task: Truncate Table
2: Dataflow Task: Datareader--Script componant--OLE DB Destination (SQL Server 2005--a single table --always around 600,000 rows)
How do I set up a transaction where if there is a failure the Truncate Table command will roll back---and the OLE Destination (A single SQL Server table) will be left the same as before the load started.
Another question with that volume of data --600,000 rows will a truncate table be pratical in a transaction
Any ides welcome
thanks in advance
David
View 3 Replies
View Related
Dec 6, 2007
HI, I need to trigger some packages upon existance of specific files in a particular directory. Sound lkike the file watcher task (from SQLIS) would do the job but I am wondering what is the difference of using this tool instead of a for each loop container. I mean, If a file exists in a directory, the for each loop container will detect it. Since the file watcher is not a service, the package containing it needs to ne scheduled on a regular basis for the filewatcher to detect the file, right? So, a for each loop container would do the job? So, waht wouldbe the advantage of using the file watcher task?
Thank you,
Ccote
View 11 Replies
View Related
Nov 7, 2007
A common issue that I run across with clients is they want only want to process a file if it's finished transmitting to the server. This SQL Server 2005 task reads the properties of a file and writes the values to a series of variables. For example, you can use this task to determine if the file is in use (still be uploaded or written to) and then conditionally run the Data Flow task to load the file if it's not being used. You can also use it to determine when the file was created in order to determine if it must be archived.
http://www.pragmaticworks.com/filepropertiestask.htm
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
Dec 20, 2007
Hi,
I'm trying to get a record count out of a databse using OLE DB Source and row count tasks but keep getting an error. I set up a variable as int32 and select the variable name in the row count task and when I go to the Input Columns tab to select a field to count, it gives me this error:
Error at Data Flow Task[Row Count[505]]: The component "Row Count" (505) has forbidden the requested use of the input column with lineage ID 32.
I don't even know what this means?
thanks,
View 4 Replies
View Related
May 8, 2006
Hi, I have to researching of how to accesss package tasks and component using the SqlServer.Dts.Runtime class and so far, I havent found any solution. For example, if you package has a scriptiong task and a data flow task(<- which contains a data source component). Is it possible to use the scripting component to access the data source component in the data flow task and manipulate its properites like sqlcommand etc.
Emmanuel
View 5 Replies
View Related
Feb 26, 2008
I've created my own posting for this. The original post was here, I apologize: http://forums.microsoft.com/forums/ShowPost.aspx?PostID=2906512&SiteID=1
According to the poster it's not possible. But there has to be some way to do it? Reflection (don't know how)?
I need to get a reference to the task host in an SSIS Task component.
Basically the scenario is this:
I have a custom task I have created. However I would like to validate that the ExecValueVariable is infact a string variable during the validate event of the task. I know how to verify its a string variable. But I can't figure out how to read what the user selected (such as User::Myvariable). The only way I've been able to figure out how to do it, but it only works if you open my custom task UI.
What I did is this:
I've implemented IDtsTaskUI and during the initialize section I wrote:
Sub Initialize(ByVal taskHost As TaskHost, ByVal serviceProvider As IServiceProvider) Implements IDtsTaskUI.Initialize
' Store the TaskHost of the task.
Me.taskHostValue = taskHost
Dim myTask As CustomTask= CType(taskHost.InnerObject, CustomTask)
myTask.myTaskHost = taskHost
End Sub
My Task is named: CustomTask. I have a public variable in my task as follows:
Public NotInheritable Class CustomTask
Inherits Task
Implements IDTSComponentPersist
Public myTaskHost As TaskHost = Nothing
Therefore I pass back the taskhost value to the CustomTask class, and voila I have it.
Problem is, this only works if the custom task calls the initialize method, and this only happens when you open the custom editor.
I then do the validation in my CustomTask class and it works fine, but myTaskHost is null/nothing until you actually open the custom task UI
How do I solve this?
View 10 Replies
View Related
Feb 23, 2007
Hi,
I created a package with SQL 2005. The package gets the Access DB and then inserts it into SQL Server.
If I open the package in .NET, I can see the SQL Task and Data Flow Task. The SQL Task has a property sqlstatementsource, which has the necxessary SQL code to create the tables.
How can I tell the SQL Task to recompile the SQL code if I give it another DB name, because the tables differ and don't map in the Data Flow Task
Thanks
View 3 Replies
View Related
Apr 3, 2008
Sometimes we have some pretty serious CPU spikes and I would like to be able to pinpoint the exact issue. I have been able through the DMVs to associate a session with an operating system thread. That's great if I have a batch that's causing the problem with a non NULL sql_handle. However, how do I further narrow down what is going on with the background service broker tasks using the DMVs? Or am I just at the blind mercy of SQL Server at this point? What can I query to know what the heck is going on?
View 10 Replies
View Related
Jun 23, 2006
Error code: 0xc0012024
Using "Integration Services Project" template in Business Intelligence Studio. Using platforms Visual Studio 2005 along with SQL Server 2005.
Getting the error while trying to execute package after loading it programmaticaly.
I've just one task "Transfer SQL Server Objects Task" on my Integration Services package. But when I try to execute it from VS 2005 project programmaticaly, it gives the above mentioned error.
The commands I use:
Package pkg = new Package();
pkg = a.LoadPackage(@"C:Documents and SettingsabcMy DocumentsVisual Studio 2005ProjectslSSISSSISPackage.dtsx", null, true);
DTSExecResult dResult = pkg.Execute();
The the error comes like: error: 0xc0012024 The task Transfer SQL Server Objects Task cannot run on this edition of Integration Services. It requires higher level edition.
Please help me.
Thanks in advance,
Bhupesh
View 11 Replies
View Related
Aug 6, 2007
I have a developer here that created an SSIS package that contains a Send Mail Task. When this developer runs the package in the Business Intelligence Development Studio (BIDS) the send mail task runs without issue. But when he tries to run it using command line and the DTEXEC program it errors out with the following error message:
Error: 2007-08-01 15:57:44.37
Code: 0xC0012024
Source: Send Mail Task
Description: The task "Send Mail Task" cannot run on this edition of Integration Services. It requires a higher level edition.
End Error
Warning: 2007-08-01 15:57:44.37
Code: 0x80019002
Source: ELMSFeed
Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
End Warning
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 3:57:24 PM
Finished: 3:57:44 PM
Elapsed: 19.922 seconds
Here are the details of his machine:
Visual Studio 2005 Version: 8.0.50727.762 (SP.050727-7600)
Under the Installed Products section it reads:
SQL Server Integration Services version: 9.00.3042.00
Once we promoted the package to a production server it runs fine. I can also run the same package from my machine without issue. So, I'm pretty sure that it's specific to his machine, but I have no idea where to start looking.
Any deas where this error comes from?
View 10 Replies
View Related
Sep 18, 2006
The two CF seem too simple to perform task like mine.
Do you often use that for what?
Thanks in advance
View 1 Replies
View Related
Mar 16, 2007
I have a SQL 2000 DTS which I imported in SSIS. The data transformation tasks were not converted, but saved as SQL 2000 transformation tasks. I want to re-write this, so that it is in compliance with 2005 standards. My problem is, I can't figure out how to capture data from a SQL task, and refer to its result set in a script task. Specifically, I want to capture data by querying a view, then refer to 2 fields in that result set in a script. I want to then transform a code into a full description, and write the transformed data to an Excel destination. The vbScript code that I used in 2000 is as follows:
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
' Copy each source column to the destination column
Function Main()
dim vEssenCode, vEssenDesc
vEssenCode = DTSSource("Essential_Code")
If vEssenCode = "E" Then
vEssenDesc = "EOC - Able to Perform"
Elseif vEssenCode = "D" Then
vEssenDesc = "Dept - Able To Perform"
ElseIf vEssenCode = "1" Then
vEssenDesc = "EOC - Not Able To Perform"
ElseIf vEssenCode = "2" Then
vEssenDesc = "Dept - Not Able To Perform"
Else vEssenDesc = "Non-Applicable"
End If
DTSDestination("Essen_Code") = vEssenDesc
Main = DTSTransformStat_OK
End Function
This worked fine until recently, but now always returns "Non-Applicable". Does anyone have any suggestions as to how I can accomplish this? I think that I have to create a data flow task with an OleDB source, send its output to an SQL Task, then send its result set to the script, do the transformation, and, finally, send its output to an Excel destination. Any suggestions will be greatly appreciated!!
View 7 Replies
View Related
Jun 25, 2007
How can I execute a sql task from a script task. Both these tasks are part of the same package. The script task is actually part of the error handler. The execute sql task is part of control flow in the package.
Thanks
View 4 Replies
View Related