October 22, 2015 at 11:53 pm
Comments posted to this topic are about the item SSIS Derived Columns
October 22, 2015 at 11:59 pm
This was removed by the editor as SPAM
October 23, 2015 at 5:03 am
Easy one. It seems Steve didn't try to kill us on Friday. 😀
October 23, 2015 at 6:38 am
Could someone please explain why it's necessary to cast NULL(DT_STR,6,1252) to (DT_STR,6,1252)?
Shouldn't it be possible to use the expression
(DT_STR,6,1252)(TRIM(DepartmentID) == "" ? NULL(DT_STR,6,1252) : TRIM(DepartmentID))
rather than
(DT_STR,6,1252)(TRIM(DepartmentID) == "" ? (DT_STR,6,1252)NULL(DT_STR,6,1252) : TRIM(DepartmentID))
October 23, 2015 at 6:39 am
Stewart "Arturius" Campbell (10/22/2015)
Nice, easy question to end the week on, thanks, Steve.However, the answers appear syntactically incomplete, e.g.
The converts to NULL and ...
should this not have rather read
The expression converts blanks to NULL and
Where blanks includes both empty strings and any number of spaces.
Also, it should be 'or' (or even 'xor') rather than 'and'. Because it doesn't do any trimming in the case of a blank, it just makes it NULL.
I was able to deduce what was meant to be the correct answer, but it is definitely in need of some cleanup.
October 23, 2015 at 7:27 am
Poorly worded. The expression does not "converts to NULL and removes beginning and trailing spaces", which implies that it first converts to NULL then removes the spaces -- clearly impossible since there would be no spaces to remove.
What it does is convert empty strings to NULL and trim leading and trailing spaces from non-empty strings.
Gerald Britton, Pluralsight courses
October 23, 2015 at 11:30 am
g.britton (10/23/2015)
Poorly worded. The expression does not "converts to NULL and removes beginning and trailing spaces", which implies that it first converts to NULL then removes the spaces -- clearly impossible since there would be no spaces to remove.What it does is convert empty strings to NULL and trim leading and trailing spaces from non-empty strings.
+1 I got the gist of what the answer choice was trying to say but your explanation is more accurate.
October 26, 2015 at 1:44 am
Nice one, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 26, 2015 at 4:12 am
I just confusing me when using the Trim function rather than thinking about the use of Derived Columns.
Thanks.
October 27, 2015 at 7:06 am
Junior Galvão - MVP (10/26/2015)
I just confusing me when using the Trim function rather than thinking about the use of Derived Columns.Thanks.
Me too
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply