Re: Max length of string global variable
- From: "mehdi" <mehdi.achour@xxxxxxx(donotspam)>
- Date: Tue, 20 Sep 2005 03:23:03 -0700
I had the same problem. I solved it this way
Well, when I launch dtsrun with a string parameter, it only passes the 255
first caracter to the global variable. So the solution is in the SQL code,
declare as many 255 variables and concatenate them in the DTS Code:
in sql code:
declare varlongstring nvarchar(4000),
varsubstring1 varchar(255),
varsubstring2 varchar(255),
.....
SET varsubtsring1 = substring(varlongstring , 1,255)
SET varsubtsring2 = substring(varlongstring , 256,510),
...
then send dtsrun /Avar1:8=varsubtsring1 /Avar2:8=varsubtsring2, .....
IN the DTS package
declare the global string variables varlongstring, var1, var2,...
and in a activeX, concatenation
DTSGlobalVariables("Varlongstring").Value =
DTSGlobalVariables("var1").Value & DTSGlobalVariables("var2").Value
DTSGlobalVariables("Varlongstring").Value =
DTSGlobalVariables("Varlongstring").Value & DTSGlobalVariables("var3").Value
Hope it's fine you
Mehdi
--
mehdi
"Andy" wrote:
> Yes it does work with a smaller size varchar, however I am getting mixed
> results. Sometimes with a larger varchar it has worked.
> "Allan Mitchell" wrote:
>
> > Should be OK
> >
> > I did this
> >
> > IN an ExecuteSQL task did
> >
> > SELECT REPLICATE('A',1000) as Value
> >
> > I assigned this to an output variable of type string
> >
> > I then had an ActiveScript task that did
> >
> > MsgBox(Len(DTSGlobalVariables("Val").Value))
> >
> >
> > The answer was 1000
> >
> > It looks as though your value is not being set. Period.
> >
> > Does it work with a smaller size varchar?
> >
> > --
> >
> >
> >
> > Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
> > www.SQLDTS.com - The site for all your DTS needs.
> > www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
> > www.konesans.com - Consultancy from the people who know
> >
> >
> > "Andy" <Andy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:BABF4C3A-1E64-4D8D-89E1-7618288E46EA@xxxxxxxxxxxxxxxx
> > > Is there a max length for DTS Global Variables of type string? I have a
> > > stored procedure that I am running using an Execute SQL Task and it is
> > > outputting a paramater of type varchar. I would like to output that
> > > parameter to the DTS package. The output parameter is at least 500
> > > characters and the global variable is showing up as not displayable.
> > >
> > > Any help is appreciated.
> > >
> > > Thanks
> >
> >
> >
.
- Prev by Date: Re: Can I run a Script at scheduled time?
- Next by Date: Re: DTS Packages Not Saving Changes
- Previous by thread: Re: Can I run a Script at scheduled time?
- Next by thread: Re: ActiveX Script User ID/Name
- Index(es):
Relevant Pages
|