YouTube2Text

SQL Server Integration Services (SSIS) Part 19 - Parameters and deployment — Transcript

by WiseOwlTutorials · 3,602 words · 498 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:00welcome to this white our tutorial on
  3. 0:03deployment and using parameters in
  4. 0:05sequel server integration services it's
  5. 0:09what you learn in the tutorial we'll
  6. 0:11begin with an introduction explaining
  7. 0:13about the two types of deployment in
  8. 0:14SSIS package and project and introducing
  9. 0:18our example package well then going to
  10. 0:21look at deploying projects so we'll show
  11. 0:22how to create a catalog in SSMS how to
  12. 0:25deploy a project and how to then execute
  13. 0:28a package that you've deployed finally
  14. 0:31we'll look at parameters so I'll show
  15. 0:33how to create and use parameters and how
  16. 0:35to group them together into things
  17. 0:37called environments so let's get started
  18. 0:41just before we begin to have a look at
  19. 0:44what parameters and deployment means can
  20. 0:46I just explain the two different ways in
  21. 0:48which you can deploy a project or
  22. 0:50packages in SSIS if you right-click on a
  23. 0:54project shown in bold type in solution
  24. 0:56Explorer you can see that you've got the
  25. 0:58option to convert it to something called
  26. 1:00the package deployment model now this is
  27. 1:03the only way of deploying which was
  28. 1:05available to you up to and including
  29. 1:07SSIS 2008 release two but from 2012
  30. 1:12onwards Microsoft have introduced a
  31. 1:14project deployment model which is so
  32. 1:16much superior in every respect that
  33. 1:18you'll be mad not to use it now the only
  34. 1:21reason I mentioned this is to emphasize
  35. 1:23that if you're watching this tutorial
  36. 1:25video and you're using a version of SSIS
  37. 1:28up to and including 2008 release 2 you
  38. 1:32can pretty much stop watching and
  39. 1:33disregard the video because it won't
  40. 1:35work for you so we're using the project
  41. 1:38deploying the model which is the default
  42. 1:40from versions of 2012 onwards and now
  43. 1:44I've got that on my chest let's have a
  44. 1:46look at the example we're going to do
  45. 1:48[Music]
  46. 1:50here's the example we're going to use
  47. 1:52for this tutorial it's slightly more
  48. 1:54complicated than you might expect
  49. 1:55because I want to be able to introduce
  50. 1:57parameters later on I've got a table of
  51. 2:00finalists that won't surprise anyone
  52. 2:02who's been watching the series of videos
  53. 2:04from the x-factor reality series there's
  54. 2:08109 of them I think
  55. 2:09and what I want to be able to do is to
  56. 2:11interrogate the database to say shimmy
  57. 2:14all the finalists whose finishing
  58. 2:16position was less than or equal to a
  59. 2:17given number so he finished here in the
  60. 2:19first second or third place and whose
  61. 2:21names contain B and I can most easily do
  62. 2:24that using SQL and I wouldn't have to
  63. 2:27touch integration services but that
  64. 2:29wouldn't be any fun and certainly
  65. 2:30wouldn't teach us about deployment or
  66. 2:32parameters so instead I set up a package
  67. 2:35to do pretty much the same thing what
  68. 2:38I'll do is just explain how it works
  69. 2:39there's two variables one is the maximum
  70. 2:42position I'm going to say 3 so I'm going
  71. 2:45to show all the finalists who got first
  72. 2:47second or third position and I want
  73. 2:50their name to contain the letter B I
  74. 2:51could type in any text I like there the
  75. 2:55first thing the package will do is run
  76. 2:57an execute SQL task and what this will
  77. 3:01do is I'll just go to expressions the
  78. 3:05sequel statement has been set to be an
  79. 3:09expression and the expression is select
  80. 3:14the finalists name from table finalists
  81. 3:18where the finishing position is less
  82. 3:21than or equal to the value of the
  83. 3:23variable I've typed in which was three
  84. 3:25converted to a two character string and
  85. 3:29the finalists name is like and then I've
  86. 3:32got percent followed by the letters I've
  87. 3:35typed in and another percent to use a
  88. 3:37wild card and if I evaluate the
  89. 3:39expression is much easier to see what
  90. 3:40it's going to do is going to run this
  91. 3:42SQL script select all the finalists by
  92. 3:45the finishing position is less than or
  93. 3:46equal to the number I've entered and the
  94. 3:48finalists name contains the text I've
  95. 3:49entered so far so good the data is saved
  96. 3:56in a result set and I've said that the
  97. 4:01first and only result set number zero is
  98. 4:03going to be stored in a variable called
  99. 4:04chosen finalists and you can see the
  100. 4:08term that's chosen fine that's defined
  101. 4:09here as an object variable and will
  102. 4:11basically hold it an array of all the
  103. 4:13finalists who've been selected if you
  104. 4:16want to find out more about this refer
  105. 4:18to the earlier tutorial on looping over
  106. 4:20aid
  107. 4:21rose after Anna execute SQL tasks what I
  108. 4:26then do is loop over the rows in this
  109. 4:28chosen finalist object variable so if I
  110. 4:31double click on that you can see it's a
  111. 4:33for each a doe enumerator so it's
  112. 4:35leaping over rows and I've chosen the
  113. 4:38object variable to be chosen finalists
  114. 4:40I've set some variable mappings I mainly
  115. 4:43selecting one thing which is a finalists
  116. 4:45name so the first and anything returned
  117. 4:47from that selection is going to be
  118. 4:50stored in the variable called finalists
  119. 4:51name so the net result of this will be
  120. 4:54this leap will loop over all the
  121. 4:55finalists returned and read the name of
  122. 4:58the finalists into a variable called
  123. 4:59finalists name I then set up an
  124. 5:03expression task within the loop set a
  125. 5:05string variable called finalists list to
  126. 5:08be what it used to be and then I'm
  127. 5:10adding on the name of the new finalists
  128. 5:13I've just discovered this rather
  129. 5:15complicated expression in the middle is
  130. 5:17just ensuring that I add on a carriage
  131. 5:20return which is backslash n for every
  132. 5:22finalist apart from the first one and if
  133. 5:25I evaluate that expression it went as
  134. 5:27she give me anything because currently
  135. 5:29these variables are blank so that's my
  136. 5:32expression the net result of running
  137. 5:34this leap will be that I'll have an
  138. 5:36accumulated string of text in the
  139. 5:37finalists variable so all I need to do
  140. 5:39is display it and I can do that with the
  141. 5:42script task I pass in the name the
  142. 5:43finalists variable and in my script I
  143. 5:46just display a message which says lists
  144. 5:52out the name or the value of that
  145. 5:54variable so that's my package is doing
  146. 5:57and what I'm going to do now is to run
  147. 5:59it to share it in action and you can see
  148. 6:01there's listening out all the finalists
  149. 6:03who got first second or third position
  150. 6:06and you have a B in their name what will
  151. 6:11now do is look at deployment using this
  152. 6:13package and then go on to look at
  153. 6:15parameters
  154. 6:16[Music]
  155. 6:19the first thing you need to be able to
  156. 6:21do before you can use a default project
  157. 6:23primum model in SSAS 2012 onwards is
  158. 6:27trace on the co2 catalog so I'm in
  159. 6:29sequel server management studio
  160. 6:31there's my x-factor database I've been
  161. 6:33using all this time and I haven't got
  162. 6:35any catalogs so what I'll do is right
  163. 6:38click and choose to create a catalog and
  164. 6:40this is probably something you'll only
  165. 6:41ever do once it automatically enables
  166. 6:45CLR integration which is good and what
  167. 6:48I'm going to do is to automatically is
  168. 6:50to tick that box which will
  169. 6:52automatically run a store procedure to
  170. 6:53tidy up settings when sequel server
  171. 6:55first begins to be honest I'm not
  172. 6:57absolutely certain what that does but it
  173. 6:59seemed a good idea and was recommended
  174. 7:01on the internet I'm going to type in a
  175. 7:04password it's test if you want to hack
  176. 7:07into this and then choose ok what I will
  177. 7:10be able to do is later to delete the
  178. 7:12catalog even if I don't know the
  179. 7:14password and you can see now that I
  180. 7:17haven't got any projects within that
  181. 7:18catalog but I'm going to remedy that now
  182. 7:20by having a look at how you can deploy
  183. 7:23projects to that catalog what I'm now
  184. 7:29going to do is show how to deploy a
  185. 7:31project to the new shiny new catalog
  186. 7:33I've just created you can do that by
  187. 7:36right-clicking and choosing on a project
  188. 7:38in solution Explorer and choosing to
  189. 7:40deploy it comes up with a wizard the
  190. 7:43first stage of the wizard is just
  191. 7:44telling you what the other stages are so
  192. 7:46what I'm going to do is click on next to
  193. 7:47go into the next stage it's validating
  194. 7:50my project so what I can now do is type
  195. 7:53in the server name in this instance the
  196. 7:57full-stop is showing the fact that the
  197. 8:00sequel server database is actually
  198. 8:02stored on my local machine so that's
  199. 8:04just like tacking typing in localhost or
  200. 8:06the name of the machine and this is
  201. 8:08acting the named instance within sequel
  202. 8:10server but the thing you type in there
  203. 8:12will be the name of your server I can
  204. 8:14then click on the Browse button and it
  205. 8:16will come up with my catalog and what
  206. 8:19I'm going to do is create a new folder
  207. 8:20within that to keep all these projects
  208. 8:22together
  209. 8:22so I'm going to call this tutorial and I
  210. 8:25could type in a description if I wanted
  211. 8:27to
  212. 8:27so you can see that's where it's going
  213. 8:30to deploy to if I click on the next
  214. 8:31button it will just review all my
  215. 8:33choices I've made and then I can click
  216. 8:35on the deploy button and it will
  217. 8:37actually do the work and you can see
  218. 8:39there's deploying the project and in a
  219. 8:41very short while that's going to finish
  220. 8:43I could save report of how this
  221. 8:46deployment went but I'm just going to
  222. 8:48close this down now if I now have a look
  223. 8:50at sequel server initially it looks very
  224. 8:52disappointing nothing's changed
  225. 8:54but that's because a management studio
  226. 8:55to refresh problem if I right-click on
  227. 8:58the catalog and choose to refresh it you
  228. 9:00can see it's created my folder within
  229. 9:03that if I click on that you can see I've
  230. 9:06got two things within it I've got a list
  231. 9:08of all the projects I've published
  232. 9:09there's any one and I've got something
  233. 9:12called environments which are
  234. 9:13collections of parameters which we'll
  235. 9:15look at later what I can do now is to
  236. 9:19expand my project have a look at the
  237. 9:21packages with it packages within this
  238. 9:23and run one or more of them which is
  239. 9:26what we'll look at now what I want to do
  240. 9:30now is look at two ways in which you can
  241. 9:32execute a package the first and most
  242. 9:34obvious way is to right-click on the
  243. 9:36name of the package I'm going to do the
  244. 9:38one we've called parameters and choose
  245. 9:40execute and it will pop up with a dialog
  246. 9:42box asking me to fill in any parameters
  247. 9:44well I haven't got any parameters I will
  248. 9:47add some later in this tutorial so I can
  249. 9:49just choose okay and it will run my
  250. 9:51package and there is the results of it
  251. 9:53in a dialog box while it's running the
  252. 9:56package is ask the question do you want
  253. 9:58to open an overview report and if you
  254. 10:01choose yes you get a quick summary
  255. 10:03report of how the package executed with
  256. 10:05all sorts of information that'll
  257. 10:08probably be enough for most people but
  258. 10:10if it isn't what you could do is
  259. 10:11right-click on your package and choose
  260. 10:13to show some of the reports you've got
  261. 10:15some standard reports all the executions
  262. 10:18which have taken place and all the
  263. 10:19validations and you can create custom
  264. 10:21reports as well I'll just show you all
  265. 10:24the executions and you can see this
  266. 10:25report has been run six times so I must
  267. 10:28have been testing things in the
  268. 10:29background
  269. 10:30Chikara and you can also see all sorts
  270. 10:33of other information about each of those
  271. 10:34executions
  272. 10:37so that's the first way to run a package
  273. 10:39the second way begins in the same way
  274. 10:42you right-click on the package and
  275. 10:43choose execute but what you can do is
  276. 10:46write your own script so I'm going to
  277. 10:49write script to a new query editor
  278. 10:51window and what you can see sequel
  279. 10:53server does is to create a script to run
  280. 10:55the package and that's quite hard to
  281. 10:58read so I'm just going to delete it and
  282. 11:00to replace it with a version which does
  283. 11:02exactly the same thing but with a few
  284. 11:04lines and comments in and you can see
  285. 11:06that what it's doing is running this
  286. 11:07store procedure called creator
  287. 11:09underscore execution to line the package
  288. 11:11up and then right at the bottom it
  289. 11:13actually starts the execution process
  290. 11:15and for experience sequel programmers
  291. 11:17there's enough information there to be
  292. 11:19able to write your own store procedures
  293. 11:21to run packages whenever you want them
  294. 11:22to whenever you want to the disadvantage
  295. 11:28of what we've done so far is that when I
  296. 11:30right-click on a package and schuster
  297. 11:32execute it I don't have an opportunity
  298. 11:33to vary what I'm saying so I'm always
  299. 11:37seeing the names of the people who came
  300. 11:39in the first three position positions
  301. 11:41news names contain the letter B I'll
  302. 11:44like to have a list of parameters here I
  303. 11:45can vary that so what I'll do is go back
  304. 11:47to integration services and add those
  305. 11:49parameters and get them to work so
  306. 11:52parameter is just like a variable but is
  307. 11:54supplied externally to the package I
  308. 11:57could create my parameters by
  309. 11:59right-clicking on my project parameters
  310. 12:00there or rather double-clicking on it
  311. 12:03but what I'm going to do instead is add
  312. 12:05them within my package and the reason to
  313. 12:08do it this way is because parameters
  314. 12:11that you're adding your package will be
  315. 12:12able to be deployed you can see I do
  316. 12:15that by clicking the parameters tab I
  317. 12:17can then click on this little icon if
  318. 12:20this looks faintly reminiscent of
  319. 12:22variables that's because it isn't works
  320. 12:24exactly the same way so I'll call my
  321. 12:26first parameter Max position which is
  322. 12:29the same as the variable name is called
  323. 12:31I don't need to do that but that's just
  324. 12:33so I can remember the names clearly and
  325. 12:36I'll call my second one name contains
  326. 12:41and that'll be a string variable and I
  327. 12:45don't actually need to set any values
  328. 12:47for these because I'll be provided at
  329. 12:48runtime what I can then do is delete my
  330. 12:51two variables because I no longer need
  331. 12:53those what only I'll need to do is go
  332. 12:55back to my package and I'll need to go
  333. 12:58into my initial s execute SQL statement
  334. 13:00tasks I'll need to go into my
  335. 13:02expressions and change the sequel
  336. 13:05statement source so instead of referring
  337. 13:08to a variable it refers to a parameter
  338. 13:10and that's easy to do because it says
  339. 13:12variables and parameters here and in
  340. 13:14fact they're listed in the same list the
  341. 13:16only difference is parameters begin with
  342. 13:18a dollar sign so what I do is get rid of
  343. 13:21my maximum position variable there and
  344. 13:25it's dead use my maximum position
  345. 13:26parameter and like over to my user name
  346. 13:29contains variable there and I'll use my
  347. 13:32name contains parameter but otherwise
  348. 13:34nothing has changed I'll click and
  349. 13:38evaluate expression just to check that
  350. 13:39no syntax errors and then choose okay
  351. 13:41twice what I now need to do is to deploy
  352. 13:45my package and indeed the whole project
  353. 13:48there was no need to save it because of
  354. 13:51the time of deployment it will save
  355. 13:52everything and build it and is saying a
  356. 13:55project with this name already exists
  357. 13:56click name to replace it I'm comfortable
  358. 13:58doing that on this occasion so I'll
  359. 14:01deploy it and what it will do is
  360. 14:03overwrite the previous project so if I
  361. 14:05now go back to sequel server you can see
  362. 14:08my project package is still there and
  363. 14:09looks exactly the same
  364. 14:11whenever I click on it to execute it
  365. 14:13it's going to come up with request for
  366. 14:15the parameter information I can now type
  367. 14:18in the maximum position except that to
  368. 14:21the I can't I need to click on the three
  369. 14:23dots rather bizarrely and I'm going to
  370. 14:25choose the first five positions and for
  371. 14:29the name contains I'm going to go for
  372. 14:31the left of e which is quite common so
  373. 14:33let's see what that produces if I choose
  374. 14:35okay and run that I won't show report
  375. 14:37and you can see I've got rather more
  376. 14:39there's a lot more finalists you finish
  377. 14:41in the first five positions and whose
  378. 14:43name contains an e so that's how you can
  379. 14:46create parameters what I'll look at next
  380. 14:48is how you can bunch them together into
  381. 14:51thing called environments the last thing
  382. 14:55I'm going to show in this tutorial is
  383. 14:57how to use some good environments
  384. 14:59what are these verses show how they work
  385. 15:01and then show how to create them I've
  386. 15:04created two environments the first one
  387. 15:06is called winners with an S and what it
  388. 15:08will show and I'll come back to this
  389. 15:10later in more detail is all the people
  390. 15:12or the finalists whose name contains an
  391. 15:15S and who got the first position the
  392. 15:19other environment I've created is called
  393. 15:21anyone with an X and what that will
  394. 15:22share is anyone who has an X in their
  395. 15:25name and you've finished it in the first
  396. 15:26three positions all I'm doing here is
  397. 15:29trying to illustrate the idea of what
  398. 15:30you could do if I then run a package you
  399. 15:34can choose either one of those two thing
  400. 15:36called environments and what it will do
  401. 15:37is substitute the parameter values so
  402. 15:39I'm going to choose winners with an S
  403. 15:40and what I will do is show all the
  404. 15:43people who won you have an S and their
  405. 15:45name if I run the package again this
  406. 15:48time I'll choose anyone with an X and
  407. 15:50this time I'll see all the people who
  408. 15:52have gotten X in their name whatever
  409. 15:53position they reached so that's what
  410. 15:55environments are the way you create them
  411. 15:57is extremely messy I think but if you
  412. 16:01get the steps in the correct order
  413. 16:02not too bad we're going to create a new
  414. 16:04environment so what you can do is right
  415. 16:06click on environments and choose create
  416. 16:08environment I'm going to call this
  417. 16:10environment first two places with M and
  418. 16:20choose okay
  419. 16:22what I can then do is double-click an
  420. 16:24Internet at it try that one again and
  421. 16:26assign variables now it's absolutely
  422. 16:29vital I use the same variable names as I
  423. 16:32have in the other two so I chose name to
  424. 16:35be my first one and that's a string
  425. 16:37variable and for the second one I chose
  426. 16:39pause and that's going to be an integer
  427. 16:42now what I'm going to do is fill in
  428. 16:45values for that so I put an M for name
  429. 16:48and for the position I'll put in the
  430. 16:50number two so we'll get positions one
  431. 16:52and two one gotcha the Nate the query
  432. 16:56string is case sensitive so if I put a
  433. 16:59capital n it's highly likely I wouldn't
  434. 17:02get any one at all because there's not
  435. 17:03many finalists who've got a capital m in
  436. 17:05their name so I'll choose ok to confirm
  437. 17:08that and that's my third environment
  438. 17:10what I now need to do is go to my
  439. 17:13package right clicking it and configure
  440. 17:15it and add a reference to the
  441. 17:18environment I've just created so you can
  442. 17:20see I've already got to which I'm
  443. 17:21referencing what I need to do is add in
  444. 17:23a third by clicking the Add button I can
  445. 17:26choose my third one which is first two
  446. 17:28places with nem and choose ok and they
  447. 17:30will add it to the list of environments
  448. 17:32I'm referencing I can choose ok the
  449. 17:37other thing I need to do with a package
  450. 17:39is although I'm referencing the
  451. 17:40environment and the environment has two
  452. 17:42variables called name and pause I need
  453. 17:45to map those variables onto the
  454. 17:46parameters in my package I did so as a
  455. 17:49messy so I need to right-click on my
  456. 17:51package and configure it and for each of
  457. 17:53the two parameters I need to click on
  458. 17:56the three dots to the right of it I need
  459. 17:58to say I'm going to use the environment
  460. 18:00variable and this is why it's so crucial
  461. 18:02I should use the same names because
  462. 18:05clearly Africa I've called the variable
  463. 18:06pause in one environment and something
  464. 18:08else in another it won't work and you
  465. 18:11can see I've already done this I've
  466. 18:12assigned the parameter called Max
  467. 18:14position to have the value of the
  468. 18:16variable called environment variable
  469. 18:18called pause and I've assigned the
  470. 18:21parameter called name contains
  471. 18:23valuing environment vandal called name
  472. 18:26the reason I've only got one item in
  473. 18:28each list is because SSAS is intelligent
  474. 18:31enough to realize that there's no point
  475. 18:33offering me up an integer variable for a
  476. 18:35string parameter and vice versa so now
  477. 18:39I've done all that I hope I can now
  478. 18:41execute my package and when I did that I
  479. 18:44could if I liked fill in values for my
  480. 18:46parameters here but instead of doing
  481. 18:49that what I can do is choose to create
  482. 18:51an environment and I can say well I'll
  483. 18:53use the first two places with em and
  484. 18:56what it will do is as it shows here is
  485. 18:58take the value of these two environment
  486. 19:00variables and substitute them in at
  487. 19:02runtime so when I choose okay I will see
  488. 19:04all of the people who finished in the
  489. 19:06first two places you have a little m in
  490. 19:09their name so that's how you create
  491. 19:11environments and that finishes this
  492. 19:14tutorial on deploying in SSIS and using
  493. 19:17parameters we hope you've enjoyed this
  494. 19:19tutorial on deployment and parameters in
  495. 19:21SSIS you can find loads more training
  496. 19:24resources on all things sequel server
  497. 19:26net and Microsoft Office at ww-why UK
  498. 19:32[Music]

About this transcript

This page contains the full transcript of SQL Server Integration Services (SSIS) Part 19 - Parameters and deployment by WiseOwlTutorials, generated from the public captions YouTube serves with the video. The transcript has 3,602 words across 498 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.