|
|
Browse by Tags
All Tags » SSIS » Script
-
To finish up the topic that I started in my previous post, I wanted to post a more complex example of running total calculations. This is based off a request on the MSDN forums, for a running total calculation that would “slide” along as additional rows were processed. In the poster’s example, the running total needed to reflect the total for the ...
-
Running totals are a common calculation for reporting, and are occasionally needed in ETL processes to populate aggregate tables. One way to accomplish this in SSIS, if you are retrieving data from a relational database, is to do the running total in the SELECT statement. There are a number of resources on the Internet that illustrate how to ...
-
A question that comes up occasionally on the forums is how to determine if a file is being written to by another process. It can cause issues if a file is partially written when a source component starts extracting data from it.
There is a way to check this through a Script Task. The script below attempts to lock the file for writing. If the file ...
-
A question that has come up in a few different situations recently is how to send someone an alert if your package is taking too long to execute. For example, you might have a package that loads a large number rows from a source system to a destination on a nightly basis. There are a number of other packages that depend on this one to complete ...
-
A topic that has come up a few times recently is the idea of loading a set of files into a database using SSIS. One of the data flow components in SSIS is the Import Column transform, which allows you to load files into a binary column. There is a great video by Brian Knight that shows how to use it, and I recommend viewing that. If you are ...
-
The File System Task in SSIS doesn't support checking to see if a file exists. You can work around this easily with a script task. Create a new script task and add a Imports statement referencing the System.IO namespace to the top of the script.Imports System.IO
Then add the following to the Main method:If ...
-
When writing script components in SSIS, it's often useful to be able to process the columns without knowing exactly what they are. For example, you may want to loop through all the columns to check for a conditional, like NULL values in the columns. Or you may want to take a set of columns and concatenate them into a single string for output, or ...
-
Previously, I posted about dynamically un-pivoting columns to rows. In this post, we'll look at the reverse scenario. Suppose that you have a list of sales orders, in this format:
Sales Order Number
Product
SO-001
Hammer
SO-001
Table Saw
SO-001
Cordless Screwdriver
SO-002
Table ...
-
A recent post on the MSDN forums was asking about using the WMI Data Reader Task to retrieve information and send it to a SQL Server destination. I wasn't very familiar with the task, so I decided to try it out. I wasn't expecting much, given some of my experiences with the WMI Event Watcher (which I have found fairly difficult to get working ...
|
|
|