Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

VBscript hacks for DTS packages Expand / Collapse
Author
Message
Posted Tuesday, July 15, 2008 11:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 05, 2010 9:31 AM
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. :)

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?
Post #534608
Posted Tuesday, July 15, 2008 11:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 05, 2010 9:31 AM
Points: 7, Visits: 25
Thanks Alan! I just updated the article to fix the type and submitted it again.
Post #534611
Posted Tuesday, July 15, 2008 11:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 05, 2010 9:31 AM
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.
Post #534621
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse