SQL Server Integration Services (SSIS) Part 5 - Data Types and Data Conversion — Transcript
Full transcript
- 0:00welcome to this wiow tutorial on SQL
- 0:03Server integration Services data types
- 0:05and data conversion
- 0:08Transformations here's what you'll learn
- 0:10on the
- 0:11tutorial we'll Begin by having a look at
- 0:13why data types matter proving that when
- 0:15you try to export information from Excel
- 0:17to SQL Server things can go horribly
- 0:21wrong we'll then look at using data
- 0:23conversion transformations to solve
- 0:25problems like this and then finally I'll
- 0:27have a look at the list of the main ssis
- 0:30data
- 0:31types so let's get
- 0:35started okay so let's look at why data
- 0:37types matter in SQL Server integration
- 0:40Services I've got here a simple
- 0:42spreadsheet of all the SQL Server
- 0:43courses wise I'll give I thought i'
- 0:45throw in a quick bit of publicity there
- 0:47and the column I want you to look at is
- 0:49a course name one which contains a text
- 0:51description of what the course is called
- 0:54and what I'm going to do is export that
- 0:56into a SQL Server table called TBL
- 0:59course
- 1:00and it contains the same three columns
- 1:03course ID course name and C number days
- 1:05and again I want you to look at the
- 1:07course name so here's my package to do
- 1:10that already set up uh beginning with
- 1:12the control flow I've got a um execute
- 1:16SQL task which will delete all the old
- 1:18courses from the table ready to start
- 1:21again and then I've got a single data
- 1:23flow task which will import all the
- 1:25courses from Excel into the new SQL
- 1:27Server table so if we have a look at
- 1:29that in more detail
- 1:30what it has is an Excel source which is
- 1:32a workbook I've just shown and a
- 1:35destination which is a table of courses
- 1:37so like I say what could possibly go
- 1:40wrong well one thing which could
- 1:42definitely go wrong is I could leave the
- 1:44Excel workbook open which is something
- 1:46I'm prone to do so I'm going to close
- 1:47that down but the second thing which is
- 1:50going to go wrong is shown by this Red
- 1:52Cross it can't convert between Unicode
- 1:55and non-unicode string data
- 1:57types and the reason for that is by
- 2:00default XO Excel holds its information
- 2:03in Unicode format so it sets aside twice
- 2:07as many bytes to hold each character as
- 2:09the SQL Server so if we look in the
- 2:13Excel workbook in more detail I'm going
- 2:16to do that not by double clicking on it
- 2:18but by right clicking and choosing to
- 2:20show the advanced
- 2:22editor so you can see on the last tab of
- 2:25this which appears the input and output
- 2:28properties
- 2:30and you can see here if I go to my
- 2:32output
- 2:33columns that the course name is being
- 2:37created using a dtore wst data type or
- 2:43Unicode string now towards the end of
- 2:46this tutorial I'll talk much more in
- 2:49much more detail about all the various
- 2:50data types and integration services for
- 2:53the moment DT stands for data
- 2:55transformation the old name for
- 2:57ssis um I have no idea what the w stands
- 3:00for and St Str stands for
- 3:02string so that's what Excel is
- 3:05exporting here's what SQL Server is
- 3:08importing because I've chosen varar it
- 3:11thinks this is a non-unicode data type
- 3:13so I've only got two bytes set aside for
- 3:16each character rather than four as it
- 3:19happens had I just put an n in front of
- 3:22it it would have created it as an nvar
- 3:24car data type which is Unicode and I
- 3:27wouldn't have had this problem but then
- 3:29again I wouldn't been able to illustrate
- 3:30how to do a data type conversion either
- 3:33so what I need to do is between my Excel
- 3:37source and my SQL Server destination I
- 3:40need to add in a transformation which
- 3:44which will convert the data type of the
- 3:46course name column into the correct
- 3:48format so what I'm going to do is break
- 3:50the link
- 3:51there and then add a transformation
- 3:54between the two parts of the data flow
- 3:58task so to add a data conversion task I
- 4:02need to find it in the list of common
- 4:05transformations in the ssis toolbox and
- 4:08drag it onto my data flow window what I
- 4:11can then do is rename it so at the
- 4:13moment it's called data conversion I'll
- 4:15call it change course name column
- 4:18because that's what it's going to do um
- 4:21and then what I can do is to
- 4:23drag the output from the Excel Source
- 4:27into my data conversion transformation
- 4:30what I then need to do of course is
- 4:31configure my data conversion to say what
- 4:33it actually does and I can do that as
- 4:35usual by double clicking on this
- 4:37icon now there's no need for me to tick
- 4:40all three columns because the course ID
- 4:43and the course number days aren't being
- 4:45affected so what I'm going to do is
- 4:47include the course
- 4:48name and as always in ssis it makes it
- 4:51as clear as it possibly can what I need
- 4:53to do so the first thing I need to do is
- 4:55to give this an output Alias so from now
- 4:58on it's going to be called shorter
- 5:01course name perhaps not a great
- 5:03description but it will serve for the
- 5:05purpose the data type and this is a
- 5:07crucial thing is not going to be a
- 5:09Unicode string it's just going to be a
- 5:12string so dtore St and that will
- 5:16correspond to a varar data type in SQL
- 5:20Server now at the moment I'm going to
- 5:22get conversion errors or rather
- 5:24truncation errors because I've set the
- 5:25length to 255 characters so what I'm
- 5:28going to do is abbreviate it to let's
- 5:31say 50
- 5:32characters and what that will do is
- 5:34automatically trate it the final thing
- 5:37I've got on this line is a code page
- 5:40which if you're working in the UK or the
- 5:42US will always be 1252 but I can click
- 5:45on the drop arrow and decide to work in
- 5:47somewhere far more exotic and
- 5:48interesting instead but I'm not going to
- 5:50do that because I'm not in an exotic or
- 5:52interesting
- 5:53place so finally I can choose okay to
- 5:56confirm that and I've completed
- 5:58configuring my my data
- 6:01conversion what I can now do is take the
- 6:03output of that and feed it into my final
- 6:06SQL Server
- 6:08destination and then I can configure my
- 6:11SQL Server destination by double
- 6:13clicking on it and what I need to do is
- 6:15change the mappings change what columns
- 6:18on the from the input are going to what
- 6:20columns in the
- 6:21destination you can see the course name
- 6:24is still going onto the course name so
- 6:26what I can do is just click on the input
- 6:27column and change it so that the thing
- 6:29which is mapped onto the SQL Server
- 6:31course name column is actually my new
- 6:33shorter converted column called shorter
- 6:36course name and then I can choose
- 6:39okay now I've already set that up to me
- 6:42to be my default package so when I
- 6:44execute this what I should do is I
- 6:47should see three green ticks as my data
- 6:50flows um without let or hindrance from
- 6:54my source to my destination taking a wee
- 6:57while to do it but there it is and if I
- 6:59I now go into SQL server and right click
- 7:01on my TBL course table and choose to
- 7:03select all the rows you should see that
- 7:06I've successfully imported all the
- 7:08courses from the Excel
- 7:11workbook so here's a list of the data
- 7:14types in SQL Server integration services
- 7:17on the left hand side we have the SQL
- 7:18Server data type and on the right hand
- 7:21side the corresponding SQL Server
- 7:23integration Services data type so you
- 7:25can see there confirmation that for
- 7:27string data types VAR car in SQL Server
- 7:30corresponds to dtor St but the Unicode
- 7:34version of that nvar car corresponds to
- 7:36dtore
- 7:38wstr moving on now to integer and
- 7:41Boolean data types the main one you'll
- 7:43need there is dtore I4 which corresponds
- 7:47to a 4 byte integer or INT in SQL server
- 7:51for floating Point data types you can
- 7:53use dtore R4 or dtore R8 corresponding
- 7:58to real or float or dtore numeric for
- 8:01decimal or
- 8:02numeric for date and time data types
- 8:05there's a list
- 8:06there and for other data types for
- 8:09completeness I've included a list for
- 8:11that too I hope you've enjoyed this
- 8:13short tutorial on data types and data
- 8:15conversion Transformations you can find
- 8:18lots more online training resources on
- 8:20SQL server.net and Microsoft Office
- 8:23applications at
- 8:25www.wis
- 8:28al.co
About this transcript
This page contains the full transcript of SQL Server Integration Services (SSIS) Part 5 - Data Types and Data Conversion by WiseOwlTutorials, generated from the public captions YouTube serves with the video. The transcript has 1,430 words across 208 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.