YouTube2Text

SQL Server Integration Services (SSIS) Part 9 - Lookup Transforms — Transcript

by WiseOwlTutorials · 4,682 words · 664 segments · language en · Watch on YouTube

Full transcript

  1. 0:00welcome to this tutorial on using
  2. 0:02Lookout transforms in integration
  3. 0:05Services here's what we'll learn on the
  4. 0:07tutorial we'll Begin by having a look at
  5. 0:10our example package which is to take a
  6. 0:12set of xfactor finalists and look up the
  7. 0:15details of each of their mentors in a
  8. 0:17separate table we'll have a look at what
  9. 0:19the package should do and then have a
  10. 0:21look at the package itself in
  11. 0:23ssis what we'll then go on to do is look
  12. 0:25at creating lookup transforms
  13. 0:28themselves and then we'll look at how to
  14. 0:30deal with the output from them so
  15. 0:31firstly how to cat with the output where
  16. 0:33there's non-matching rows where we
  17. 0:34didn't find a corresponding mentor and
  18. 0:37then have how to copee with the fact
  19. 0:38when we have found a corresponding
  20. 0:41Mentor we'll then go on to finish the
  21. 0:43package using a union query and finally
  22. 0:46we'll go on to look at ways to speed up
  23. 0:47processing the package either by using
  24. 0:49full or partial caching with an
  25. 0:51explanation of what that means or by
  26. 0:53using cach
  27. 0:55transforms so let's get
  28. 0:58started welcome to this tutorial on
  29. 1:00using lookup transformations in SQL
  30. 1:03Server integration
  31. 1:04Services we've got quite a lot to cover
  32. 1:07and it's important I think that I
  33. 1:08explain clearly the example we're going
  34. 1:10to try to solve at the beginning so you
  35. 1:12can see where we're
  36. 1:13going I've got here the familiar Excel
  37. 1:16workbook of UK xact contestants and what
  38. 1:19we're going to do is import these into a
  39. 1:21SQL Server table now the two contestants
  40. 1:24I want you to particularly concentrate
  41. 1:26on are One Direction a little known boy
  42. 1:28band and new Vibe if you look at the men
  43. 1:32to uh assigned to each of those Simon
  44. 1:36cowl is assigned to One Direction and
  45. 1:38TSA contostavlos is assigned a new
  46. 1:41Vibe now when we come to import these
  47. 1:43into our SQL Server table what we're
  48. 1:45going to do is look up the mentor's name
  49. 1:48in a separate SQL Server table of
  50. 1:49mentors and here it is so we've got the
  51. 1:52mentor ID and the mentor name when we
  52. 1:55look up Simon cowl there will be no
  53. 1:58problem SQL Server will will detect the
  54. 2:00fact that the mentor ID is eight and
  55. 2:02store that as a mentor ID against the
  56. 2:04corresponding
  57. 2:06finalist but the problem will come with
  58. 2:08t Lisa conoa whatever her name is
  59. 2:11because it will then look up her Mentor
  60. 2:13name in the list and fail to find it and
  61. 2:16what we're going to do then is store the
  62. 2:18not known Mentor ID 9 against her
  63. 2:22name if we look at the finist table
  64. 2:24which will be imported One Direction
  65. 2:27will come in with the mentor ID 8
  66. 2:29corresponding to Simon cowl and we'll
  67. 2:31set some notes to say it's imported okay
  68. 2:34whereas new Vibe will have a mentor ID
  69. 2:36assigned to it of nine meaning not known
  70. 2:39and notes will say that TSA wasn't
  71. 2:42found this is a very standard thing to
  72. 2:44do when importing data and integration
  73. 2:46Services you have a set of um
  74. 2:50data let me just go back to my Excel
  75. 2:52workbook you have a set of data with a
  76. 2:54lookup field which is more or less
  77. 2:55populated but inevitably there'll be new
  78. 2:57values in that list and what a look C
  79. 3:00transformation allows you to do is to
  80. 3:02detect where there's a new value and
  81. 3:04store a sensible corresponding number
  82. 3:07next to
  83. 3:09it so let's have a look at the
  84. 3:12integration Services package which will
  85. 3:14achieve what we want to achieve on the
  86. 3:16control Flow side is extremely simple
  87. 3:18there's only two tasks the first one is
  88. 3:21an execute SQL task and if we have a
  89. 3:24look at the SQL assigned to it all it
  90. 3:26will do is truncate the table of TBL
  91. 3:28finalist so basically it will remove all
  92. 3:30the old records ready for the new ones
  93. 3:31to come in the only other task is a data
  94. 3:35flow task and if we have a look at that
  95. 3:37in more detail this is of course where
  96. 3:39the complexity
  97. 3:41lies we'll begin with taking Excel
  98. 3:43source of the finalists using an Excel
  99. 3:46Connection Manager and we'll feed that
  100. 3:48into a lookup
  101. 3:50transform and what this will do is spit
  102. 3:53two streams of data out if it can't find
  103. 3:56the corresponding Mentor name in the SQL
  104. 3:58Server table the ray will flow down the
  105. 4:00lookup no match output and go to this
  106. 4:04transform whereas if it can find a
  107. 4:06mentor it will go down the lookup match
  108. 4:08output and come into this
  109. 4:10transform what will happen then it
  110. 4:13depends on whether which path it went
  111. 4:15down if it was unable to find a match
  112. 4:17for the mentor name what it will do is
  113. 4:20create a new Mentor ID field and assign
  114. 4:22the value nine to it meaning this Mentor
  115. 4:25wasn't known and it will also set the
  116. 4:27notes to record the fact there was a
  117. 4:28problem
  118. 4:30on the other hand if it could find the
  119. 4:31mentor name what it will do is just use
  120. 4:34the mentor ID it's looked up from the
  121. 4:36other Mentor table and it will record
  122. 4:38the noes to say that it imported
  123. 4:41okay what we'll then do is use a union
  124. 4:43query to recombine those two sets of
  125. 4:45data into a single data set and Export
  126. 4:48that into the SQL Server table of
  127. 4:51finalists so we'll Begin by having a
  128. 4:53look at the lookup
  129. 4:54transform and to do that we need to go
  130. 4:56to the next part of this tutorial
  131. 5:01before we create the lookup
  132. 5:02transformation let's have a look at what
  133. 5:04elements of the package I put in place
  134. 5:06already on the control Flow side we've
  135. 5:09got an initial execute SQL task which
  136. 5:12will run against the connection I've
  137. 5:14already created to the xfactor database
  138. 5:17and truncate the table of fin lists so
  139. 5:19basically we'll remove all the old fin
  140. 5:20lists ready to import the new
  141. 5:22set and I've also got a data flow task
  142. 5:26which will import the new set of data
  143. 5:27looking at the mentor's details and of
  144. 5:30course it's that which we need to look
  145. 5:31into so for go into that I've already
  146. 5:34created an Excel source which will take
  147. 5:37the worksheets of finalists and what I'm
  148. 5:39now going to do is create a lookup
  149. 5:41transform to split them into those who
  150. 5:43have mentors and those who
  151. 5:45don't I've already cunningly got the
  152. 5:48name for this task in the clipboard so
  153. 5:50I'll paste that in and then very
  154. 5:54carefully I will resize
  155. 5:58this because
  156. 6:00resizing tasks with long names in SQL
  157. 6:02Server integration Services isn't an
  158. 6:04easy thing to
  159. 6:06do what I'm now going to do is feed the
  160. 6:08output from the first worksheet into
  161. 6:10this lookup transform in familiar
  162. 6:13fashion grit my teeth as it resizes it
  163. 6:17and get it back to how I want it to
  164. 6:19look and then what I'm going to do is
  165. 6:21configure this lookup transform so it
  166. 6:23spits out two types of data those
  167. 6:26finalists who have got mentors in the
  168. 6:27mentors table and those who don't
  169. 6:30to do this I need to double click in it
  170. 6:32as always I'm going to explain cach mode
  171. 6:35later towards the end of this tutorial
  172. 6:37so for the moment I'll just leave them
  173. 6:38as a default settings and I'll go
  174. 6:41straight onto the
  175. 6:43connection the table or view is not the
  176. 6:46one of fin lless which is where the data
  177. 6:48is coming from but the table in which
  178. 6:50I'm looking up the mentor details so I
  179. 6:52choose the mentor table to be the one
  180. 6:54containing the lookup
  181. 6:56information if you use Excel regularly
  182. 6:58you can think of this is your lookup
  183. 7:01table now I'm going to look at the
  184. 7:03columns and what I'm going to do is say
  185. 7:05that the mentor name in the finalist
  186. 7:07table should match up to the mentor name
  187. 7:09in the lookup table and I can do that by
  188. 7:12dragging one column onto the
  189. 7:15other what I now need to do is say which
  190. 7:18columns I'm going to export from this
  191. 7:20lookup transform and the only thing I
  192. 7:22want to actually keep is the mentor ID
  193. 7:25so I'm going to add that as a new column
  194. 7:27to the output so now I've got the
  195. 7:29situation from the lookup transform it
  196. 7:31will send out all the existing columns
  197. 7:33from the finist table as output plus one
  198. 7:36new one called Mentor ID which I want to
  199. 7:38add as a new column which is abolutely
  200. 7:40the only choice and I'm going to give
  201. 7:42the that new column the name of Mentor
  202. 7:44ID the same as it was called in the
  203. 7:47lookup table so I can then choose
  204. 7:50okay now unfortunately there's one thing
  205. 7:52I've forgotten to do which is to specify
  206. 7:55what will happen to the information
  207. 7:56coming out of this lookup transform so
  208. 7:59I'm going to go back into it now and
  209. 8:02where it says specify how to handle rows
  210. 8:04with no no no matching entries I'm going
  211. 8:07to choose to redirect these rows to a no
  212. 8:10match
  213. 8:11output now to see what this means I'll
  214. 8:14just choose okay to confirm that I'm
  215. 8:16going to add in two derived column
  216. 8:18transforms and I'll configure these
  217. 8:20later in the next part of this tutorial
  218. 8:22so I'll put one there and I'll put one
  219. 8:25there when I drag the output from the
  220. 8:29lookup transform into one of the these
  221. 8:31derived column
  222. 8:33Transformations it will ask me which
  223. 8:35output I mean do I mean the output where
  224. 8:38I successfully found a matching Mentor
  225. 8:40or Jo I mean is in this case the ones
  226. 8:42where I didn't successfully find a
  227. 8:44matching
  228. 8:45Mentor so if I choose okay to that I can
  229. 8:48then do the same thing for the other
  230. 8:50stream of output and it will
  231. 8:52automatically assume that I mean the the
  232. 8:55uh finalist where I've successfully
  233. 8:57found a matching mentor so that's what a
  234. 9:00lookup transform does it splits the data
  235. 9:02into two parts those where it can find a
  236. 9:04match in the corresponding lookup table
  237. 9:06sorry that one and those where it
  238. 9:08couldn't find a match and in the next
  239. 9:10part of this tutorial we'll have a look
  240. 9:12at the two derived column
  241. 9:13transformations to see how we can
  242. 9:15manipul the data which comes out of the
  243. 9:17lookup
  244. 9:20transform in the previous part of this
  245. 9:22tutorial we created a lookup transform
  246. 9:24to split the table of fin lists from
  247. 9:27Excel into two parts those where no
  248. 9:29corresponding Mentor could be found and
  249. 9:32those where corresponding Mentor could
  250. 9:33be
  251. 9:34found what I'm now going to do in this
  252. 9:36part of the tutorial is configure the
  253. 9:38derived column transform to create two
  254. 9:41new columns for each finalist where
  255. 9:44there wasn't a corresponding mentor and
  256. 9:46I think it's worth at this point going
  257. 9:47back to SQL Server to see what those new
  258. 9:49columns will two new columns will
  259. 9:51contain the mentor ID will contain the
  260. 9:54number nine because that's the value of
  261. 9:57the not known mentor and the will say
  262. 10:00some notes on why the mentor's name
  263. 10:02couldn't be
  264. 10:05found we'll go back to integration
  265. 10:07services and I dislike having to
  266. 10:09hardcode any value into a package I
  267. 10:11create so what I'm going to do is create
  268. 10:13a pack uh a variable to hold the number
  269. 10:17of the not known
  270. 10:18mentor and having little or no
  271. 10:21imagination I'll call it not known
  272. 10:24Mentor
  273. 10:25ID and I'll give it a value of nine and
  274. 10:28the advantage of this approach is that
  275. 10:30in future if for some reason the value
  276. 10:32of that record number changes what I'll
  277. 10:35be able to do is just go in and change
  278. 10:36the value of my variable and everything
  279. 10:38will still work
  280. 10:39okay so what I can now do is probably
  281. 10:42rename my derive column transform using
  282. 10:45text already in my clipboard and then
  283. 10:48resize it I think I'm beginning to learn
  284. 10:50the message that long names are
  285. 10:53bad and what I can then do is configure
  286. 10:55it to say how it's going to
  287. 10:57work now I'm going to create two new
  288. 10:59columns as explained the first one I
  289. 11:02will call Mentor
  290. 11:04ID and I want it to be a new column in
  291. 11:06the table I don't want it to replace any
  292. 11:09existing one I wanted to add to the uh
  293. 11:11output from the final spreadsheet
  294. 11:12already there and the expression for
  295. 11:15this should just be the value of the
  296. 11:16variable called not know Mentor ID and
  297. 11:19so I can simply drag that down from the
  298. 11:21variables into that space so far so
  299. 11:25good the second column I want to create
  300. 11:27is the notes table and again I want
  301. 11:30sorry noes column again I want this to
  302. 11:32be a new column and for this one what I
  303. 11:35can do is take the column called Mentor
  304. 11:37which will contain the name of the
  305. 11:40mentor drag that into my expression and
  306. 11:43then concatenate onto the end of that
  307. 11:45the words not
  308. 11:47known and in theory that should all work
  309. 11:51perfectly however it will actually yield
  310. 11:53to a problem if you look at the length
  311. 11:55assigned to that by integration Services
  312. 11:57it's 265 characters
  313. 11:59uh ssis gets that by taking the standard
  314. 12:01length of an Excel text column which is
  315. 12:03255 and adding on 10 characters for the
  316. 12:06words not known all that would be fine
  317. 12:09were not for the fact that in SQL Server
  318. 12:11my let expand that my notes column is
  319. 12:15255 characters and you can't fit 265
  320. 12:19characters into
  321. 12:20255 what I need to do then is shorten
  322. 12:23this and I can do that by converting the
  323. 12:26type of it using a type cast function
  324. 12:30and I'm actually going to use dtore wstr
  325. 12:34which will convert it to a Unicode
  326. 12:35character string but with less
  327. 12:37characters in so I'm going to um change
  328. 12:41this to two5 five
  329. 12:44characters and what that should do is
  330. 12:46truncate it but it still says
  331. 12:49265 and the reason for that is I need to
  332. 12:53include this expression in Brackets so
  333. 12:56that it's truncating the whole
  334. 12:58expression to 250 5 characters and not
  335. 13:00just the mentor's name and now it will
  336. 13:03reduce it back down to 255
  337. 13:05characters if I then choose okay to
  338. 13:07confirm that I'm hoping I've
  339. 13:09successfully configured it so that this
  340. 13:11derived column transform will take in
  341. 13:13all the columns from the existing
  342. 13:15finless spreadsheet and add two more of
  343. 13:17its own so that when I come to export
  344. 13:19the DAT data to SQL Server I can set the
  345. 13:22standard six columns and there'll be two
  346. 13:24more available to me as
  347. 13:26well what I now need to do is do the
  348. 13:28same same thing for those finalists
  349. 13:31where we did successfully find a men in
  350. 13:33the mentor's lookup and to do that I
  351. 13:35need another derived column
  352. 13:38transform it's time now to turn our
  353. 13:40attention to the second derived column
  354. 13:42transform the one which will take those
  355. 13:44finalist where we successfully looked at
  356. 13:46the mentor ID and add a new column
  357. 13:48saying that this was imported okay the
  358. 13:51first thing I'll do is just rename the
  359. 13:53second derive
  360. 13:54column using a name I've got in my
  361. 13:57clipboard and with a bit of luck I'll
  362. 13:58success resize it and what I'll now be
  363. 14:01able to do is reconfigure this to have a
  364. 14:03look at the columns it's
  365. 14:05exporting it's already got the mentor ID
  366. 14:08column because we've already
  367. 14:09successfully looked up the final list in
  368. 14:11the mentor's table so all we need to do
  369. 14:13is add a second column giving some notes
  370. 14:16and I'm using the same name as I did in
  371. 14:18the previous uh derive column transform
  372. 14:20just to make life
  373. 14:22easier I'm going to put the expression
  374. 14:23for that as a bit of text saying that I
  375. 14:26was able to import it okay
  376. 14:30and if I then choose okay with a bit of
  377. 14:33luck both the two derived column
  378. 14:35transforms are now exporting the
  379. 14:38original columns in the finalist table
  380. 14:40plus two more the mentor ID and the
  381. 14:43notes in the case of this derived column
  382. 14:46transform the mentor ID is being set to
  383. 14:48nine in the case of this derived column
  384. 14:50transform the mentor ID is the one which
  385. 14:52we've looked up in the mentor's
  386. 14:54table the last thing we need to do to
  387. 14:57get our package working is to recombine
  388. 14:59the two tables together we're using a
  389. 15:01unor query or unor transform as you call
  390. 15:04it and so to do that I'll choose a unor
  391. 15:06transform add it into my package and
  392. 15:09then direct the Alpha from my two
  393. 15:11derived column transforms into it and
  394. 15:15I'll also rename it so it says it will
  395. 15:17combine the tables back together which
  396. 15:21seems a reasonable name what I'm now
  397. 15:23going to do is configure this to check
  398. 15:25the columns are being mapped
  399. 15:27correctly and you can see for my two new
  400. 15:29columns Mentor ID and notes they're
  401. 15:33being exported into an alpha column with
  402. 15:35exactly the same
  403. 15:37name had I not given such consistent
  404. 15:40names to my columns I would have had to
  405. 15:42create a new column and map columns from
  406. 15:45the original two tables onto it but
  407. 15:47because I chose consistent names I don't
  408. 15:49have to do that so I can choose okay to
  409. 15:51confirm that and what I now need to do
  410. 15:54is to direct the output from this Union
  411. 15:56query into my SQL Server table
  412. 15:59and to do that I can put in a
  413. 16:01destination
  414. 16:02assistant I can choose my SQL Server
  415. 16:05Connection I've already got
  416. 16:07created I can direct the output from the
  417. 16:09union or query into it and I can
  418. 16:12configure my destination to say that the
  419. 16:14information is going into the finalist
  420. 16:16table and then finally I need to go to
  421. 16:18my mappings and what I need to do is
  422. 16:21check that the right columns from The
  423. 16:22Source are going to the right columns in
  424. 16:24the
  425. 16:25destination and as it happens the ID is
  426. 16:27going to a column called Excel finalist
  427. 16:29ID the name is going to a column called
  428. 16:31finalist name and the finished column is
  429. 16:35going to be the position in which the
  430. 16:36final is finished and we're going to
  431. 16:38ignore the other
  432. 16:40columns if I then choose okay to confirm
  433. 16:43that I think I've now got a working
  434. 16:45package so let's give it a will if I run
  435. 16:48my package by clicking on the play Tool
  436. 16:51hopefully it will import the data lots
  437. 16:53of green ticks which is a good sign and
  438. 16:55you can see the five rows have gone
  439. 16:57sorry five rows have gone G through the
  440. 16:59no match output pipe and 103 rows have
  441. 17:02gone through the match output pipe those
  442. 17:04are then recombined back here to send
  443. 17:06108 rows into the final
  444. 17:08table so if I have a look at that final
  445. 17:10table in SQL server with a bit of luck
  446. 17:13it will contain 108 rows there it is and
  447. 17:16as I scroll down you can see the first
  448. 17:18103 of the ones which were imported okay
  449. 17:21and right at the bottom there's five
  450. 17:23rows where we couldn't import it because
  451. 17:25we couldn't find the corresponding
  452. 17:26Mentor in the mentor's table so
  453. 17:28everything seems to work
  454. 17:31perfectly as the final part of this uh
  455. 17:34tutorial what we're going to have a look
  456. 17:36at is cashing ways to speed up the way
  457. 17:39in which your lookup transform
  458. 17:44Works we've got our package working
  459. 17:46perfectly but the question remains how
  460. 17:48quickly will it run as it happens I
  461. 17:51think the answer to that is very quickly
  462. 17:52indeed we've only got 108 uh finalists
  463. 17:57and we're only looking up nine men ERS
  464. 17:59so I don't think speed is going to be an
  465. 18:01issue but what would happen if there
  466. 18:03were 108,000 men finalists or Parish
  467. 18:05thought 108 million in that case we
  468. 18:08might be more concerned about how our
  469. 18:10caching is going to work of data you can
  470. 18:13see the options by double clicking on
  471. 18:15the lookup transform task and seeing the
  472. 18:17cash mode and there are three
  473. 18:19possibilities full cash partial cash or
  474. 18:21no cash at all in full cach mode what
  475. 18:25integration services will do is load up
  476. 18:27the entire table lookup table of mentors
  477. 18:30at the very beginning of the task and
  478. 18:33because there's only nine of them it
  479. 18:34won't occupy a great deal of
  480. 18:37memory at the other end of the extreme
  481. 18:39is no cache what will happen then is
  482. 18:42every single time uh integration
  483. 18:43Services comes to a mentor it will look
  484. 18:46for it in the table at a fresh and have
  485. 18:48no memory of what the table used to look
  486. 18:50up the last time it loaded it this is
  487. 18:52clearly wildly
  488. 18:54inefficient a sensible Middle Way
  489. 18:56perhaps is partial caching
  490. 18:59what partial caching will do is set
  491. 19:01aside an amount of memory you can
  492. 19:03actually control how much of it there
  493. 19:05that is by going to the advanc tab and
  494. 19:07changing the amount according to whether
  495. 19:09you're using a 32-bit or 64-bit
  496. 19:12processor we're going to use a default
  497. 19:14of 25
  498. 19:15megabyte in a partial cache what will
  499. 19:18happen is this integration services will
  500. 19:21find Louie Walsh it will look up Louis
  501. 19:23Walsh and the list of mentors and find
  502. 19:24that Louis Walsh is number five it will
  503. 19:27then create in his cache a miniature
  504. 19:30table containing Mentor ID 5 Mentor name
  505. 19:33Louis
  506. 19:34Walsh when it comes to the next finalist
  507. 19:38who coincidentally is also mentored by
  508. 19:40Louie Walsh it won't have to go back to
  509. 19:42the lookup table it will go to the cach
  510. 19:44and look it up far quicker from that it
  511. 19:47will then add Simon cowl to its cach
  512. 19:49Sharon Osborne and so
  513. 19:51on this technique clearly works best
  514. 19:54when you have a very large number of
  515. 19:56Records but only a few things things
  516. 19:58that you're actually looking up so the
  517. 20:00cach size remains relatively small and
  518. 20:03partial caching seems the most sensible
  519. 20:05option to
  520. 20:06me now in addition to that you can also
  521. 20:09create something called cache connection
  522. 20:11managers and that's what we're going to
  523. 20:12have a look at in the final part of this
  524. 20:17tutorial the final part of this tutorial
  525. 20:19will consider a way to make Lookout
  526. 20:21Transformers work even quicker than
  527. 20:23using partial
  528. 20:24caching it relies on the fact that
  529. 20:27getting information directly from s
  530. 20:28server is actually not the fastest thing
  531. 20:30we can do the quickest thing we could do
  532. 20:33would be to load our table of mentors
  533. 20:37and there it is into a special cache
  534. 20:40file with an extension of
  535. 20:42caw and to do that what we're going to
  536. 20:45do use is a cache
  537. 20:46transform what we can then do is in
  538. 20:48integration Services rather than getting
  539. 20:50our information for the lookup directly
  540. 20:52from olb from SQL Server we can get it
  541. 20:55from the cache file we've created and
  542. 20:57this is to Advan vantages one is it will
  543. 21:00run much more quickly because it's
  544. 21:02quicker getting information from the
  545. 21:03cache than it is from the
  546. 21:04olb and the second Advantage is that it
  547. 21:07may well be the case that somewhere else
  548. 21:08in our package we want to do another
  549. 21:10look up from the same table and we'll
  550. 21:12already have the cache file created so
  551. 21:14we won't have to reload it into
  552. 21:16memory so to get this to work the first
  553. 21:19thing I need to do is go back to my
  554. 21:20control flow and add another data flow
  555. 21:23task and what this is going to do is to
  556. 21:25load the mentors into uh
  557. 21:30cache what I'll then do is just run that
  558. 21:32straight into the next control flow
  559. 21:34task if I then double click on that to
  560. 21:37configure it I need to add two things to
  561. 21:39it in the data flow the first is a
  562. 21:42source which tells it where the
  563. 21:43information is coming from so it's going
  564. 21:46to get the information from the mentor
  565. 21:48table so I can use a Connection Manager
  566. 21:49already set up and if I then double
  567. 21:52click on that I can choose the table
  568. 21:55itself and then choose okay and for the
  569. 21:59sake of Elegance I'll rename that and
  570. 22:03call it mentor's
  571. 22:05table so that's where my data is coming
  572. 22:08from the place it's going to as
  573. 22:11mentioned is a cache file and to do that
  574. 22:14I can use a cache transform you won't
  575. 22:16find that in the common transform
  576. 22:18section it's in the other
  577. 22:20transforms so what I'll do is create my
  578. 22:22cache
  579. 22:23transform feed my data from the mentor
  580. 22:26table directly into it and perhaps Reen
  581. 22:28name it to say create cache
  582. 22:31file what I'll then need to do is to
  583. 22:34configure this cache file if I double
  584. 22:36click on it the first thing I need to do
  585. 22:38is create a Connection Manager I could
  586. 22:41have done this separately but I'll do it
  587. 22:42as part of configuring the cache
  588. 22:44transform so what I need to do is click
  589. 22:46on the new button I'll call my new
  590. 22:49Connection Manager
  591. 22:51mentors
  592. 22:53table and if I then go to columns you
  593. 22:57can see that it's automatically going to
  594. 22:59take the mentor ID and the mentor
  595. 23:01name now at this point when you're
  596. 23:03configuring a cache Connection Manager
  597. 23:05there's a very easy mistake to make what
  598. 23:08you should do is index the mentor name
  599. 23:11because that is the field which you're
  600. 23:13looking up against so for example when
  601. 23:16you have a f list it's a mentor's name
  602. 23:18Louis Walsh that you want to find and
  603. 23:20nothing else if you make the mistake of
  604. 23:23me in indexing the mentor ID as well it
  605. 23:25would lead to problems later on in this
  606. 23:29if I then choose okay to confirm that
  607. 23:31and then choose okay sorry if I then go
  608. 23:34to mappings you can see that it's taking
  609. 23:37the mentor ID and the mentor name from
  610. 23:38the original uh olb source and mapping
  611. 23:42onto the mentor ID and Mentor name in
  612. 23:44the cache which is exactly what I want
  613. 23:45to happen so I can choose
  614. 23:49okay so that's my data flow task
  615. 23:52complete so the first thing which will
  616. 23:54happen when I run this package is it
  617. 23:55will load the mentors from SQL Server
  618. 23:57into a cach file which will be available
  619. 23:59for my lookup
  620. 24:01transform what I now need to do is go to
  621. 24:03that lookup apologies what I now need to
  622. 24:05do is go to my lookup
  623. 24:07transform configure it and say that
  624. 24:10instead of using an olb Connection
  625. 24:12Manager so instead of getting it
  626. 24:14information directly from a table in SQL
  627. 24:16Server I'm going to use the cache
  628. 24:18Connection Manager
  629. 24:20created it says my connection type has
  630. 24:22changed so I need to go to the
  631. 24:24connection Tab and I need to choose a
  632. 24:26connection manager but integration
  633. 24:28Services have thoughtfully already done
  634. 24:30that for me on my
  635. 24:31behalf everything else will work exactly
  636. 24:34the same way I did earlier but I need to
  637. 24:36check for my columns that it is matching
  638. 24:38the mentor name in the original finalist
  639. 24:41worksheet to the mentor name in my cache
  640. 24:43which it is doing and that it's spitting
  641. 24:45out the mentor ID still so if I choose
  642. 24:48okay my belief is that the only thing
  643. 24:51I've just changed is where the mentor's
  644. 24:53information is coming from so it should
  645. 24:55work exactly the same way as it did
  646. 24:56before but quicker let's see if it does
  647. 24:59so if I click on the play tool to run
  648. 25:01that it's imported all the data if I go
  649. 25:04to my fin lists and have a look at those
  650. 25:06you can see it's imported 108 finalist
  651. 25:08just as it did before the only
  652. 25:11difference is if I just come out of
  653. 25:13debugging at the time the package was
  654. 25:15running it had created a cache file
  655. 25:17containing the mentor's details which I
  656. 25:19could reuse in another
  657. 25:22transform and that's pretty much the
  658. 25:24whole story on lookup transforms I hope
  659. 25:26you've enjoyed what has been a slightly
  660. 25:27longer tutorial than average please come
  661. 25:29back for more in the series you can find
  662. 25:32much more information on net SQL server
  663. 25:35and Microsoft Office training at www.
  664. 25:38w.c.

About this transcript

This page contains the full transcript of SQL Server Integration Services (SSIS) Part 9 - Lookup Transforms by WiseOwlTutorials, generated from the public captions YouTube serves with the video. The transcript has 4,682 words across 664 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.