Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


VBscript hacks for DTS packages


VBscript hacks for DTS packages

Author
Message
alfreitas
alfreitas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 25
igor.bustiuc (7/11/2008)
Hello!

Still working with VBScript in 2008 year?

Something about .NET it could be very, very interesting.

Regards.


That's true. But even if it work with DTS, I would have problems to convince DBAs to learn OOP and .NET just to deal with simple scripts. Smile

Reusing code in DTS is not a simple task too. How I would be able to justify the burden of using OOP if I cannot reuse code easily?
alfreitas
alfreitas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 25
Thanks Alan! I just updated the article to fix the type and submitted it again.
alfreitas
alfreitas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 25
Antares686 (7/11/2008)
First off I will say it was a nice article and offers so good alternatives. However I will point out two things.


Thanks for the feedback Antares686!


First, in part one there is a " missing in your build of the function right in front of Scripting.Dictionary in the line that reads

sCode = sCode & "Set dictionary = CreateObject(" & chr(34)_ 
& Scripting.Dictionary" & chr(34) & ")" & vbCRLF
For Each sKey in aEntries.Keys()



This is minimal but for those who cannot figure out why this isn't working it should read

sCode = sCode & "Set dictionary = CreateObject(" & chr(34)_ 
& "Scripting.Dictionary" & chr(34) & ")" & vbCRLF
For Each sKey in aEntries.Keys()





Thank you! I fixed that in the article.


In addition I am not sure I would consider it helpfull to hide the parameters with this method as you really don't save a lot (and even on a large number of variables you have to resolve somehow the errors). Your statement that you can change variables also does not work as you will have to resolve any issues you get.


I'm not sure I really understand the point: even if the method hides the parameters, is easily to explain (the package interface) to another person how to use the package with Execute Package Task if he/she will need to use just one parameter. And the developer can always use some sort of debugging to get information about which values were used during package execution.


Second, I completely disagree with part two, at least based on the example, as I think many people just have not figure out how to manage the things the parameter button cannot parse.

...

To get around this you just need open "Disconnected Edit" (right click on any whitespace of the design area or under Package menu). Once open then expand Tasks and pick the correct item with a name similar to "DTSTask_DTSExecuteSQLTask_" it will have the same description as what you just set if you bothered changing it. Anyway, there you will find an entry titled "InputGlobalVariableNames", edit this item and enter your variable input value like so


Using Disconnected Edit like that may work, but it will make the life of a developer without good documentation or project background more difficult to figure out how the previous developer (me) could make a query work in the DTS package or not! That's make unit testing harder too.

But it's a nice tool also to have available when you need to do a quick fix.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search