dbTalk Databases Forums  

Global Variable - Output Parameter not returning value

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


Discuss Global Variable - Output Parameter not returning value in the microsoft.public.sqlserver.dts forum.



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

Default Global Variable - Output Parameter not returning value - 05-05-2005 , 01:46 PM






Hello Gurus,

I have SQL 2000 DTS package transfers data from one server to another
server. I have execute sql task with following sql
SELECT count(*) FROM table1
In output parameter i have created Global variable with output parameter
type =Rowset

On sucess i call following activexscript

set objResults = DTSGlobalVariables("gResultsMaterial").Value
while not objResults.EOF
strRecord = "Records transferred: " & objResults.Fields(0).value

objStream.WriteLine(strRecord) (ObjStream is File System Object to write
output in txt file)

objStream.WriteBlankLines(1)
objResults.MoveNext
wend

sometimes, instead of writing exact count(*) as result in text file, it is
resulting ZERO. This does not happen everyday, almost twice in a week.

I have scheduled (windows scheduler) to run dts package, all i have
following code in that batch file.

dtsrun /s SERVERNAME /E /N myDTSpackagename

Any help,

Thanks,
Krish



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Global Variable - Output Parameter not returning value - 05-05-2005 , 02:31 PM






Would this not be a row value as opposed to the Rowset?

The value is then in the Global Variable

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"Krish" <NOspam (AT) Nospam (DOT) org> wrote

Quote:
Hello Gurus,

I have SQL 2000 DTS package transfers data from one server to another server. I have execute sql task with following sql
SELECT count(*) FROM table1
In output parameter i have created Global variable with output parameter type =Rowset

On sucess i call following activexscript

set objResults = DTSGlobalVariables("gResultsMaterial").Value
while not objResults.EOF
strRecord = "Records transferred: " & objResults.Fields(0).value

objStream.WriteLine(strRecord) (ObjStream is File System Object to write output in txt file)

objStream.WriteBlankLines(1)
objResults.MoveNext
wend

sometimes, instead of writing exact count(*) as result in text file, it is resulting ZERO. This does not happen everyday, almost
twice in a week.

I have scheduled (windows scheduler) to run dts package, all i have following code in that batch file.

dtsrun /s SERVERNAME /E /N myDTSpackagename

Any help,

Thanks,
Krish





Reply With Quote
  #3  
Old   
Krish
 
Posts: n/a

Default Re: Global Variable - Output Parameter not returning value - 05-05-2005 , 02:56 PM



You are right, it should be row value, but iam not sure how it works
sometime and does not work sometime.

Thanks,
Krish

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Would this not be a row value as opposed to the Rowset?

The value is then in the Global Variable

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"Krish" <NOspam (AT) Nospam (DOT) org> wrote in message
news:urGXFLaUFHA.1204 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello Gurus,

I have SQL 2000 DTS package transfers data from one server to another
server. I have execute sql task with following sql
SELECT count(*) FROM table1
In output parameter i have created Global variable with output parameter
type =Rowset

On sucess i call following activexscript

set objResults = DTSGlobalVariables("gResultsMaterial").Value
while not objResults.EOF
strRecord = "Records transferred: " & objResults.Fields(0).value

objStream.WriteLine(strRecord) (ObjStream is File System Object to write
output in txt file)

objStream.WriteBlankLines(1)
objResults.MoveNext
wend

sometimes, instead of writing exact count(*) as result in text file, it
is resulting ZERO. This does not happen everyday, almost twice in a week.

I have scheduled (windows scheduler) to run dts package, all i have
following code in that batch file.

dtsrun /s SERVERNAME /E /N myDTSpackagename

Any help,

Thanks,
Krish







Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Global Variable - Output Parameter not returning value - 05-05-2005 , 03:06 PM



neither am I right now either but give this a go.

Could you be catching the table with no rows therein?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"Krish" <NOspam (AT) Nospam (DOT) org> wrote

Quote:
You are right, it should be row value, but iam not sure how it works sometime and does not work sometime.

Thanks,
Krish

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Would this not be a row value as opposed to the Rowset?

The value is then in the Global Variable

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"Krish" <NOspam (AT) Nospam (DOT) org> wrote

Hello Gurus,

I have SQL 2000 DTS package transfers data from one server to another server. I have execute sql task with following sql
SELECT count(*) FROM table1
In output parameter i have created Global variable with output parameter type =Rowset

On sucess i call following activexscript

set objResults = DTSGlobalVariables("gResultsMaterial").Value
while not objResults.EOF
strRecord = "Records transferred: " & objResults.Fields(0).value

objStream.WriteLine(strRecord) (ObjStream is File System Object to write output in txt file)

objStream.WriteBlankLines(1)
objResults.MoveNext
wend

sometimes, instead of writing exact count(*) as result in text file, it is resulting ZERO. This does not happen everyday, almost
twice in a week.

I have scheduled (windows scheduler) to run dts package, all i have following code in that batch file.

dtsrun /s SERVERNAME /E /N myDTSpackagename

Any help,

Thanks,
Krish









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.