Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Data Warehousing
»
Integration Services
»
Best Practice
Best Practice
Rate Topic
Display Mode
Topic Options
Author
Message
CGSJohnson
CGSJohnson
Posted Thursday, November 08, 2012 6:20 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 1:31 AM
Points: 1,385,
Visits: 1,085
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
Post #1382456
GSquared
GSquared
Posted Thursday, November 08, 2012 7:23 AM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:55 PM
Points: 15,442,
Visits: 9,571
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
Post #1382486
CGSJohnson
CGSJohnson
Posted Thursday, November 08, 2012 7:29 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 1:31 AM
Points: 1,385,
Visits: 1,085
Thanks for the reply.
Post #1382493
Koen Verbeeck
Koen Verbeeck
Posted Friday, November 09, 2012 12:33 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 1:21 AM
Points: 9,374,
Visits: 6,471
For the sake of readability I use option B. But this is a personal choice.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1382863
CGSJohnson
CGSJohnson
Posted Friday, November 09, 2012 10:02 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 1:31 AM
Points: 1,385,
Visits: 1,085
OK...thanks.
Post #1383115
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.