Percentage Sampling Transformation in SSIS with Example

361
39869

Friends,

Percentage Sampling transformation is similar to the TOP keyword in Sql Server. Just like TOP in SQL, Percentage Sampling Limits the records that are gonna flow through pipeline by the given integer as Percentage. Let’s say I have 1000 records in my source table and if I connect the same source to PERCENTAGE SAMPLING transformation by providing Limit records values to 10 then 10% of total records will be flowed from the transformation. Let us see an example of the same.

  • Open a new project and drag a Data Flow task from toolbox in Control Flow.
  • Edit the Data Flow task by double clicking the object or by selecting EDIT button on Right click on the object.
  • Make sure the Data Flow Page is opened as shown below.

  • Select OLE DB data source from data flow sources and drag and drop it in the data flow.
  • Double click on the OLE DB data source to open a new window where we can set the properties of the connection.
  • Select the connection manager and click on new button to set the connection string as shown below.

  • Set the connection to the database by providing the Server name,database name and authentication details if required.
  • After the connection is set, select Data Access mode as “Table or View” as shown below and then select the table which we are gonna use as input to PERCENTAGE SAMPLING Transformation.

  • Now select the columns that needs to be present as part of source by going to Columns Page in OLE DB Data Source as shown below.

  • Now drag and drop Percentage Sampling transformation and connect OLE DB source output as input to this transformation as shown below.

  • Now edit the Percentage sampling transformation and select PERCENTAGE of rows out of total records in the Source table you wants to use as sample by mentioning  it “Percentage of rows”.
  • Give some meaningful names to Sample Output and Unselected output and use “Use the following random seed” option to get Random values from the source rather than getting TOP records.

  • These are all the properties we can set for Percentage Sampling transformation. Now lets create couple of destinations to store Sampled output and not sampled output. I have taken OLE DB destination to push Sampled output and Flat File destination to push non sampled output.
  • Now drag the output of Percentage Sampling transformation to give source to OLE DB destination and it will prompt us to select the INPUT (we have two, one sampled and another one not sampled) and select Sampled output as shown below.

  • Select the Non Sampled output to Flat file destination and set the connection settings for both OLE DB and Flat File destinations. (You can see configuring destinations in the post here)
  • Now the package is ready to execute and do the same. Make sure all the items turn GREEN.

  • You can observe the records from source got grouped into two different pipelines based on the percentage we have given.

This is it !! This is one of the simplest transformation(to configure) available in SSIS and useful when ever you wish to limit the records flowing to destination.

Happy Coding !!

Regards,

Roopesh Babu V

361 COMMENTS

  1. A sublingual cannabis spray is now also available from GW Pharmaceuticals and has been approved as of 2011 for use by prescription in the UK, Canada, Spain, Germany, Denmark, and the Czech Republic.
    Any consumer can easily sildenafil 100 at affordable prices from a trusted pharmacy
    The symptoms of metastatic cancers depend on the location of the tumor, and can include enlarged lymph nodes which can be felt or sometimes seen under the skin and are typically hard , enlarged liver or enlarged spleen, which can be felt in the abdomen, pain or fracture of affected bones, and neurological symptoms.

  2. Signs and Symptoms of Depression in Children The signs of depression in children ages six to 12 are similar to those seen in adults.
    out the substantial discounts quoted through this site for vardenafil (levitra) products online? Will it be real or generic?
    Patients with a history of kidney disease, chronic liver disease, congestive heart failure, electrolyte abnormalities or suspected inflammatory bowel disease should not take this medication.

  3. 888starz download bangladesh [url=http://www.888starz-downloads.com]888starz download bangladesh[/url] .

  4. tadaga 20 https://www.fundable.com/tadaga

    0950663759 – Vladimir (Sergey) Romanenko (Obman, Kidalo)!

    +38 095 0663759 – Владимир (Сергей) Романенко, Одесса – Мошенник, продает нерабочий товар на OLX!

  5. Sharing, a detailed overview on Mexican Pharmacy safety. The author describes how to avoid scams for antibiotics. Link: п»їhttps://polkcity.us.com/# pharmacy mexico online.

  6. п»їLately, I found a great resource about Mexican Pharmacy standards. It covers the safety protocols for generic meds. In case you need cheaper alternatives, check this out: п»їUpstate Medical. It helped me.

  7. п»їActually, I discovered a useful resource regarding cheap Indian generics. It details CDSCO regulations on prescriptions. If you are looking for factory prices, go here: п»їhttps://kisawyer.us.com/# india online pharmacy. Might be useful.

  8. п»їTo be honest, I stumbled upon an interesting resource concerning buying affordable antibiotics. The site discusses WHO-GMP protocols for generic meds. If anyone wants reliable shipping to USA, take a look: п»їbest online pharmacy india. Worth a read.

  9. п»їRecently, I came across an informative page about cheap Indian generics. The site discusses how to save money for generic meds. For those interested in Trusted Indian sources, go here: п»їsee more. Worth a read.

  10. Just wanted to share, a detailed overview on FDA equivalent standards. The author describes quality control for ED meds. Source: п»їhttps://polkcity.us.com/# tijuana pharmacy online.

  11. п»їJust now, I stumbled upon a helpful guide concerning generic pills from India. The site discusses the manufacturing standards for generic meds. For those interested in factory prices, take a look: п»їkisawyer.us.com. Good info.

  12. п»їTo be honest, I stumbled upon an interesting guide about ordering meds from India. It details CDSCO regulations for generic meds. If anyone wants cheaper alternatives, take a look: п»їkisawyer.us.com. Good info.

  13. п»їJust now, I stumbled upon a helpful guide about Indian Pharmacy exports. The site discusses CDSCO regulations for generic meds. If you are looking for cheaper alternatives, check this out: п»їbest india pharmacy. Might be useful.

  14. If you want to save money on prescriptions, I suggest visiting this report. The site explains prices for generics. Huge savings at this link: п»їhttps://polkcity.us.com/# mexico meds.

  15. п»їActually, I stumbled upon a great report about ordering meds from Mexico. It explains FDA equivalents for ED medication. For those interested in reliable shipping to USA, read this: п»їpolkcity.us.com. Worth a read.

  16. п»їActually, I stumbled upon a great guide about buying affordable antibiotics. It details WHO-GMP protocols on prescriptions. For those interested in cheaper alternatives, take a look: п»їindia pharmacy. Worth a read.

  17. п»їLately, I stumbled upon an informative article regarding buying affordable antibiotics. The site discusses CDSCO regulations on prescriptions. In case you need factory prices, check this out: п»їkisawyer.us.com. Worth a read.

  18. Hey all! Check out a useful online drugstore to order medications at a discount. Pharmiexpress provides express shipping on all meds. For fast service, highly recommended: pharmiexpress.com. Best regards.

  19. п»їMerhaba arkadaЕџlar, gГјvenilir casino siteleri arД±yorsanД±z, bu siteye kesinlikle gГ¶z atД±n. En iyi firmalarД± ve bonuslarД± sizin iГ§in inceledik. GГјvenli oyun iГ§in doДџru adres: п»їhttps://cassiteleri.us.org/# cassiteleri.us.org bol Еџanslar.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

+ thirty six = forty one