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.
I use oledb connection in the script just like as follows:
msConnStr = "Provider=SQLOLEDB;SERVER=" & msServer & ";DATABASE=" & msDb msConn = New OleDbConnection(msConnStr) msConn.Open() ds = New DataSet msData = New OleDbDataAdapter(msSqlStr, msConn) rows = msData.Fill(ds, "TableName")
This command is working fine, I just need to ask if there is a method to do retry on the connection if the connection cannot be opened for reasons like server is temporary down? instead of just make the script task a failure. Thanks in advance.
Helo, I'm using a simple scripting task to update the value of a variable:
Public Sub Main() Dim EndeJahr As String EndeJahr = InputBox("Text") Dts.Variables("EndYear").Value = EndeJahr MsgBox(Dts.Variables("EndYear").Value) Dts.TaskResult = Dts.Results.Success End Sub
The Package is working fine and the message box shows the actual value.
My problem is that when I change the of value of my variable, the value of variable is not changing, when I restart my package!!! What's the problem? any ideas?
Hi all, I am new to SSIS...and wanted to know where can i get a lot of info on how to deal with ActiveX Scripttasks & Script tasks in SSIS...the place i am working has a lot of VB Scripting done in DTS Packages...having a hard time in understanding the Scripts, as i am more like back-end guy and wanted to learn a lot in SSIS, once i understand the scripts it will help me a great deal as to how to approach the tasks...Is there any website which teaches how to avoid Scripting in SSIS as i read somewhere that Scripting should be avoided as much as possible by making using of so many tasks in the SSIS tool.
I will look forward for someone to help me out and show me a way.
Hi, Does anyone have any suggestions on a book about scripting in SSIS. I'm currently using the WROX SQL Server 2005 Integratin Services book. This is an excellent book, but I need something that has more on scripting in SSIS. My background is dba work, not programming. Thanks.
Hi all, I am new to SSIS...and wanted to know where can i get a lot of info(from web/book) on how to deal with ActiveX Scripttasks & Script tasks in SSIS...the place i am working has a lot of VB Scripting done in DTS Packages...having a hard time in understanding the Scripts, as i am more like back-end guy and wanted to learn a lot in SSIS, once i understand the scripts it will help me a great deal as to how to approach the tasks...Is there any website which teaches how to avoid Scripting in SSIS as i read somewhere that Scripting should be avoided as much as possible by making using of so many tasks in the SSIS tool.
I will look forward for someone to help me out and show me a way.
Is The Rational Guide to Scripting SQL Server 2005 Integration Services Beta Preview by Donald Farmer the best way to learn how to use scripting in SSIS as of late 2006? I'm not a .NET developer, although I come from a Java and C++ background.
I already own Professional SQL Server 2005 Integration Server, but that one doesn't cover scripting so much.
Hi guys, I got these errors when writing a scripting component. Anyone encounteer these errors before?
Warning 1 The dependency 'EnvDTE' could not be found. Warning 2 The dependency 'Microsoft.SqlServer.VSAHosting' could not be found. Warning 3 The dependency 'Microsoft.SqlServer.DtsMsg' could not be found. Warning 4 The dependency 'Microsoft.SqlServer.VSAHostingDT' could not be found.
I am utlizing a scripting object in my ssis to combine two text files into one final file, and then I want to delete the original files. To do this I am utilizing the FileSystemInfo namespace and associating the file names, then utilizing the DELETE functionality.
The creation of the final file works perfectly...unfortunately, my base files do not delete, and I do not get a failure message or indictator.
Here is my code:
' Microsoft SQL Server Integration Services Script Task ' Write scripts using Microsoft Visual Basic ' The ScriptMain class is the entry point of the Script Task.
' 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()
Dim strCurrentMonth As String Dim strCurrentYear As String Dim strWriteFileName As String Dim strReadHeaderFileName As String Dim strReadBodyFileName As String
'Utilizing a case statement, determine the monthname & year and set the appropriate variables Select Case Month(Now()) Case 1 strCurrentMonth = "January" Case 2 strCurrentMonth = "February" Case 3 strCurrentMonth = "March" Case 4 strCurrentMonth = "April" Case 5 strCurrentMonth = "May" Case 6 strCurrentMonth = "June" Case 7 strCurrentMonth = "July" Case 8 strCurrentMonth = "August" Case 9 strCurrentMonth = "September" Case 10 strCurrentMonth = "October" Case 11 strCurrentMonth = "November" Case 12 strCurrentMonth = "December" End Select
strCurrentYear = Year(Now()).ToString
'Set variables with file names (reader files and write file) for ease in readability and to 'set final (write file) with appropriate nameing convention utilized by Matria HealthCare.
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 :-)
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).
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.
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
Sorry guys, I'm really new to this. Can somebody tell me the easiest way to use the FTP task with a dynamic local path. I just want the FTP task to send whatever file is in the directory I specify.
I'm creating a package that extracts data from a table to a pipe-delimited file. I then use an external process (since using Expressions for it was a nightmare) to rename the file so that it'll reflect the previous month (e.g. April2008_report.txt). Then, I have to FTP that file. That's where my problem is. It seems I need to specify the exact filename on the local path of the FTP task, and since the filename will change each month... well, you see my problem.
Is there a way to tell the FTP task to just send *.txt, or something to that effect?
I have a master database. Based on certain criteria's I will be creating one new database. Once I have finished the creation, I have to check the value of a particular column in both database tables.
This is actually a status check. if both are not equal i have to update detail database table column value with master column value.
I thought i can use lookup transform for this. The problem is master database table's status datatype and detail table's status datatype is diff.
Can anyone suggest me any other way for this problem?
In my package i am loading data from a flat file into multiple tables like table1, table2, table3 all tables have a column called cust_num. But data for this column cust_num is only coming in table1 and i need to load the data from this column to other tables how can i do this.
I have written the Dynamic TSQL S-Proc. Below is what i wanted to implement in SSIS using foreach loop container as a cursor. But i am little doubtful whether I can achieve the dynamics to this level. I know everything is possible but is it advisable to go for this simple Sproc or SSIS tasks.
I have some 15 tables being populated using this SPROC.
Here is some helpful description ENTITYNAME gives me the table i need to work FIELDNAME gives me the field i have to work on CHANGEDVALUE gives me the value changed in that field ( This three i get from source table which is about 9000 rows and containing 15 possible ENTITY to be work on and 100's of their respective FIELD )
while in Cursors i need to get using these above variables other variables like FLAG KeyName
Thrugh SQL1 I get the KeyValue
then using this KeyValue check if the data exist update else insert new data.
QUESTION: IS THIS ADVISABLE to go for SSIS task or just carry with SPROC?
I m having an FTP Task in SSIS project, from where I have downloaded .csv file.
And also having a Processed Folder in which the processed .csv files are kept.
Main task is to download file from FTP and check , if the date of downloaded file is newer than file in processed folder, then only process that file. Else skip the processing
I have written a very basic Script Task using VS 2005, it just looks through a sqlDataReader and display a message. I want this script to be triggered by an SQL Agent. I am not sure what to do from this point on. How do I publish or whatever it is called to get it to the SQL server or agent? This is my very first attempt, no I have no clue what I am doing, will need lots of help and tutorials, thanks for reading.
i am trying to generate a dynamic connection string using a variable 'servername' i know where and how to do it but i am not sure abt the details of the paramenters that are to be passed in the script
and anyone give me a sample script
this is what iam trying to do
Public Sub Main() ' Dts.Connections("SQL????").ConnectionString = "Data Source????" + Dts.Variables("servername").Value.ToString() + ???windows authentication and what else ???? ' Dts.TaskResult = Dts.Results.Success End Sub
Hi there, I'm still pretty new to SSIS, what I am really battling with is getting a custom task to work. I have developed a custom task, digitally signed it added it to the Global Assembly Cache, written the UI for it - Pretty much as it is done here: http://technet.microsoft.com/en-us/library/ms136080.aspx but my problem is that when I drag it from the tool box into the control flow pane, I get this message: "The task user interface specified by type name 'XXXXXXXXXXXXXXXXXXX' could not be loaded. (Microsoft.DatatransformationServices.Design).
Does anybody have an idea of what I am doing wrong here?
Please help me i am new to ssis ....I am trying to send an email using mail task and I am sure that ISP works fine with smtp. I am entering all the correct information in the task but it takes a long time to run the task and then comes back with a failure error. can someone help me find an easy way to send an email to group of emails...I even tried to send it to 1 email and it is still not working.
I am new to SSIS. I wanted to do a daily ETL load from sourceA to targetB database
Please let me know the best method to that i should follow to do the below task
1. Get the Yesterday's date or last months's from-date & to-date dynamically. 2. Pass the from-date and to-date to my source SQL [e.g select emp_name, emp_dept from emp where hiredate between @param1 and @param2]. Acually my source sql has subquery and the parameters has to be passed to the subquery's where clause. 3. Insert the resultset into a staging table in the targetB database. 4. Join this targetB table with another table in sourceC db 5. finally load the result set in to the targetT database table 6. How to configure/schedule this package so that it runs daily, automatically pass the yesterday's date to the package.
I have done this using Oracle PL/SQL but my requirement is to do this in SSIS. I am not sure which control flow or transformation items to be used to do this in an effecient way.
When I first installed BI Studio everything was working fine, but I went into it today and I noticed that the FTP task seems to be missing, I can't see it in the toolbox, everything else appears to be their but not that.
Any idea how I can get this back, I really don't wont to uninstall and reinstall at the moment, and I'm not even sure if that would work.