November 8, 2012 at 6:20 am
Good morning. I just have a quick question for you folks. Do you know if when using a Script task in SSIS, is it best practice to create a local variable to hold a value from a variable created at the package or container level, as opposed to just reading directly from the package/container-level variable? For example, out of scenarios A and B below, which is better/best practices?
A:
MessageBox.Show(Dts.Variables["strErrorDescription"].Value.ToString());
B:
string errDesc = Dts.Variables["strErrorDescription"].Value.ToString();
MessageBox.Show(errDesc);
Thanks...Chris
November 8, 2012 at 7:23 am
I'm accustomed to using the package variable, not a script-local one. But that's habit, not something based on actually comparing efficiency/performance/anything.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 8, 2012 at 7:29 am
Thanks for the reply.
November 9, 2012 at 12:33 am
For the sake of readability I use option B. But this is a personal choice.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 9, 2012 at 10:02 am
OK...thanks.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply