dbTalk Databases Forums  

Re: Type mismatch error while saving Pkg with ARRAY global variable

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Re: Type mismatch error while saving Pkg with ARRAY global variable in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Type mismatch error while saving Pkg with ARRAY global variable - 09-02-2004 , 02:16 PM






I seem to remember I did this as well and was told you cannot do it like
this.

Why do you need the GV?

Why not use an array inside the VBScript task?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"dwaine" <dwaine (AT) nospam (DOT) nospam> wrote

Quote:
I've seen lots of posts (and solutions) with people trying to save
recordsets
to a global variable. However, I seem to be the only one trying something
that would be as common and more simple in my opinion, creating an
explicit
global variable of type array.

Basically, I'm parsing a file to get the names of DTS pkgs to run and
placing the list into an array of strings to be processed by subsequent
tasks. I want the variable defined EXPLICITLY so I can easily access it
in
the scripting window. I can run the step that populates the variable and
save the package as long as I don't try to explicitly define the global in
the package properties. If I try to define it on the global variables tab
(as
a string OR <other>), then running the step works, but the package won't
save. Looking in the global variables tab shows the type has been changed
to
BLANK.

A simple test case follows, if TestArray is explicityl defined as ANY type
and the step is run, the package can't be saved! This is a show stopper
for
long term maintenance of packages.

Function Main()
'Create test array and place in explicit global
dim strTest(2)
strTest(0) = "One"
strTest(1) = "Two"
msgbox strTest(0) & " and " & strTest(1)

DTSGlobalVariables("TestArray").Value = strTest

Main = DTSTaskExecResult_Success
End Function




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.