SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we will do a small task on copying the data from the source table to a destinationfile using the OLEDB source and FlatFile destination as shown in the screen above.Now let’s configure both the tasks to make a flow as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 350
SQL Server Integration Services (SSIS) – Step by Step TutorialSource Configuration:w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 351
SQL Server Integration Services (SSIS) – Step by Step TutorialDestination Configuration:w w w .f5 d e b u g .n e tOnce we are done with the configuration setting we can see our screen look as shownin the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 352
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow when we execute the package it will do the execution but we are not sure atwhat point what happens. So in order to see the transformation between the sourceand the destination we can use a data viewer browser.Data viewer provides different options to view the data, the types are: Grid,Histogram, Scatter Plot, and Chart Format. In this sample we will see on how to usethe Column Chart option to view. To start the data viewer Right click on the greenarrow which connects the source and destination and select the data viewer. It willopen the window as shown below.© Karthikeyan Anbarasan, www.f5Debug.net 353
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow click on Add button to do the configuration of our required data viewer. It willopen the window as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 354
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we will select the Column Chart since we are going to see how to use the ColumnChart. We have a tab Column Chart just navigate to that tab and select the column asshown below.© Karthikeyan Anbarasan, www.f5Debug.net 355
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we are done with the configuration and ready to execute the package. We cansee a viewer icon next to the arrow as shown below which indicates that the viewer isactive to view.© Karthikeyan Anbarasan, www.f5Debug.net 356
SQL Server Integration Services (SSIS) – Step by Step TutorialNow we will execute the package and see the data viewer browser. Press F5 toexecute the package and we can see the data viewer browser as shown in the screenbelow.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 357
SQL Server Integration Services (SSIS) – Step by Step TutorialWe have an arrow button in the browser, once we are done with our analysis we canclick on the button to proceed. Once we click that button the execution start andproceed further and the final screen will appear as shown in the screen below.w w w .f5 d e b u g .n e tConclusionIn this chapter we have seen on how to use the data viewer (Column Chart) to analyzethe data and to proceed further which acts like a debugging portion for SSIS packaging.© Karthikeyan Anbarasan, www.f5Debug.net 358
SQL Server Integration Services (SSIS) – Step by Step Tutorial Chapter 60 OLE DB COMMAND TASKIntroductionIn this chapter we are going to see how to use the OLE DB Command Task in SSISpackaging. OLE DB Command task is mainly used for set of transformation thathappen on each row of the SQL command which will be executed using this task.Basically the executed SQL Statements are handled as parameters which will bemapped to the table as an external source.Let’s jump start to see this sample how to set the properties of the control.StepsFollow steps 1 to 3 on my first chapter to open the BIDS project and select the rightproject to work on integration services project. Once the project is created, we willsee how to use the OLE DB Command to see the flow.Now once the project is opened drag and drop a source and an OLE DB Commandtask as shown in the screen below.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 359
SQL Server Integration Services (SSIS) – Step by Step TutorialWe can see some red marks on each task which indicates that the tasks are notconfigured. We need to configure each task so that while execution we can have asmooth process. In our example we need two tables as source and destination. Sowe have created 2 tables as shown in the screen below.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 360
SQL Server Integration Services (SSIS) – Step by Step TutorialScriptCreate table EmployeeSalarySource(EmpSourSalaryint,EmpSourGrossint,EmpSourHRAint)Create table EmployeeSalaryDestination(EmpDestSalaryint,EmpDestGrossint,EmpDestHRAint)Select * from EmployeeSalarySourceSelect * from EmployeeSalaryDestinationNow we will insert some data to the source table so that we will see a real timeexample on the same as shown in the screen below.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 361
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we have a source data table and a destination data table with some sampledata in the source table, in order to proceed with our transformation using OLE DBtask we need to create a stored procedure which takes 3 values as input andprocess a simple insert statement in the destination table with small manipulation.So we will create a stored procedure as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 362
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tScriptCreate procedure dbo.usp_CalculateEmpSalary@intEmpSourSalaryint,@intEmpSourGrossint,@intEmpSourHRAintASSET NOCOUNT ONInsert into EmployeeSalaryDestination (EmpDestSalary, EmpDestGross, EmpDestHRA)Values(@intEmpSourSalary * 10,@intEmpSourGross * 5,@intEmpSourHRA * 2)Now we are ready with the source and destination table with a stored procedurewhich prepares the transformation steps. Now let’s configure the task step by stepas shown in the screens below.© Karthikeyan Anbarasan, www.f5Debug.net 363
SQL Server Integration Services (SSIS) – Step by Step TutorialFirst we are going to configure the OLEDB Source, in this we need to specify oursource table as shown in the screen below.w w w .f5 d e b u g .n e tWe can see the mapping table column names by navigating to the tab Columns atthe right side menu as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 364
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow once we are done with the configuration for the Source tables we can see thered mark is removed as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 365
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we will configure the OLE DB Command task, we need to double click thesame to go the configuration window. Once we double click we will see thewindow as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 366
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we will see how to configure this task. First select the connection manag ername using the drop down as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 367
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow move to the next tab Component properties. Here we need to specify thesource command that is to be executed across each row on the component. Sincein our case it’s going to be the stored procedure we should select the procedure asshown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 368
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we need to move to the next tab Column Mapping. Here we are going to mapthe respective columns from the stored procedure to the table so that each will bemapped and the respective columns take care of execution as shown in the screenbelow.© Karthikeyan Anbarasan, www.f5Debug.net 369
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we are ready with our package to build and execute it. Press F5 to build thepackage and execute the same. You can see the screen looks like below.© Karthikeyan Anbarasan, www.f5Debug.net 370
SQL Server Integration Services (SSIS) – Step by Step TutorialThis indicates that the execution is completed and we can see the desired outputin the table destination as shown in the screen below.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 371
SQL Server Integration Services (SSIS) – Step by Step TutorialConclusionIn this chapter we have seen how to use the OLE DB Command task to execute astatement on each row set by set and to get the desired result after manipulation.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 372
SQL Server Integration Services (SSIS) – Step by Step Tutorial Chapter 61 PERCENTAGE SAMPLING (SELECTED OUTPUT)IntroductionIn this article we are going to see how to use Percentage Sampling transformation inSSIS Packaging. Percentage sampling transformation is used to split the data set intoseparate outputs based on the percent and send it to different transformations forprocessing the data set.This task is specifically used for data mining; we can divide the data and send itacross as per our requirement.Let’s jump start to see this sample how to set the properties of the control.StepsFollow steps 1 to 3 on my first article to open the BIDS project and select the rightproject to work on integration services project. Once the project is created, we willsee how to use the Percentage sampling to see the flow.Now once the projects is opened drag and drop a source and a Percentage samplingtask as shown in the screen below.w w w .f5 d e b u g .n e t© Karthikeyan Anbarasan, www.f5Debug.net 373
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tWe can see some red marks on each task which indicates that the tasks are notconfigured. We need to configure each task so that while execution we can have asmooth process.Now let’s configure each and every task to execute the package. First let us start withthe OLEDB Source as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 374
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow go to the mappings tab and see the list of columns in the source table which aremapped correctly as shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 375
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we are done with the source, we need to configure the percentage samplingtask now. To do that double click on the task will open the window as shown in thescreen below.© Karthikeyan Anbarasan, www.f5Debug.net 376
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tHere we need to specify the percentage of rows to be affected in this transformationand to proceed further. In our sample we are going to select as 40 as shown in thescreen below.© Karthikeyan Anbarasan, www.f5Debug.net 377
SQL Server Integration Services (SSIS) – Step by Step Tutorialw w w .f5 d e b u g .n e tNow we are done with the Percentage sampling task, we need to configure thedestination section where the results are expected. To do that drag and drop thegreen arrow to the destination task which we created earlier. It will open aconfiguration window to select the output name from the percentage sampling taskas shown in the screen below.© Karthikeyan Anbarasan, www.f5Debug.net 378
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431