SSIS Integration Services | Script components exercise | Create a script component to filter films into acceptable or not

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

You can learn how to do this exercise if you attend one of more of the courses listed below!

Software ==> SSIS Integration Services  (46 exercises)
Version ==> SSIS 2012 and later
Topic ==> Script components  (2 exercises)
Level ==> Average difficulty
Courses ==> Fast track SSIS  /  Advanced SSIS
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Create the following data flow task to read films in from the above workbook, and set a flag called IfAcceptable to divide them into into two groups:

The package dividing films

If you're successful you should get 34 unacceptable films. Notes follow below!

To determine whether a film is successful or not, use a script component to set the value of a boolean column called IfAcceptable according to the following rules:

Column Not acceptable if ...
RunTimeMinutes The length of the film is more than 240 minutes (4 hours).
Genre The genre is Horror.
Title The film title contains the words Twilight Saga.

The thinking behind this is that overlong, horror or Twilight films should never be made ...

Here's a fragment of code to nudge you on your way (for conducting the third test).  The ToLower() function ensures that we won't have any case-sensitivity problems: 

// if Twilight Saga, reject

if (Row.Title.ToLower().Contains("twilight"))

{

When you've finished, close your package down.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post