dbTalk Databases Forums  

Pass multiple parameters in Execute SQL Task

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


Discuss Pass multiple parameters in Execute SQL Task in the microsoft.public.sqlserver.dts forum.



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

Default Pass multiple parameters in Execute SQL Task - 07-12-2005 , 10:28 AM






I had written an earlier question about how to do a "where" clause
inside an Execute SQL Task properties.

I thought that I might be able to create a global variable in script
that'd have the where part of it in there, and would fill in the part of
the where clause that I was wanting to use.

I had in mind passing a second parameter into the Execute SQL Task
properties where the clause:

"where DTSGlobalvariables("OccursCount").value = 0"

which in activex script would already be evaluated when it came to the
SQL that would be inserting the record. I can't figure out how to add a
second parameter to it though.

Another question, regarding branching in it (another plan) was in the
example in

http://www.sqldts.com/default.aspx?218

But what I can't figure out is how A resolves to whatever step in the
job the step preceding it resolved it to be A.

In the example, where does the name:

DTSStep_DTSActiveScriptTask_1

come from?

I'm not following how that dts name above resolves to A in the example.

I see what it's doing, but not sure if I understand how it knows where
to go, based on the names within SetupPath and A,B,C and X,Y,Z.

BC

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

Default Re: Pass multiple parameters in Execute SQL Task - 07-12-2005 , 02:06 PM






You idea about the WHERE and GVs will never AFAIK know work which is why I
suggested using workflow

Right click on a task Workflow | Workflow Proerties | options

--



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


"Blasting Cap" <goober (AT) christian (DOT) net> wrote

Quote:
I had written an earlier question about how to do a "where" clause inside
an Execute SQL Task properties.

I thought that I might be able to create a global variable in script
that'd have the where part of it in there, and would fill in the part of
the where clause that I was wanting to use.

I had in mind passing a second parameter into the Execute SQL Task
properties where the clause:

"where DTSGlobalvariables("OccursCount").value = 0"

which in activex script would already be evaluated when it came to the SQL
that would be inserting the record. I can't figure out how to add a
second parameter to it though.

Another question, regarding branching in it (another plan) was in the
example in

http://www.sqldts.com/default.aspx?218

But what I can't figure out is how A resolves to whatever step in the job
the step preceding it resolved it to be A.

In the example, where does the name:

DTSStep_DTSActiveScriptTask_1

come from?

I'm not following how that dts name above resolves to A in the example.

I see what it's doing, but not sure if I understand how it knows where to
go, based on the names within SetupPath and A,B,C and X,Y,Z.

BC



Reply With Quote
  #3  
Old   
Blasting Cap
 
Posts: n/a

Default Re: Pass multiple parameters in Execute SQL Task - 07-12-2005 , 03:51 PM



Allan Mitchell wrote:
Quote:
You idea about the WHERE and GVs will never AFAIK know work which is why I
suggested using workflow

Right click on a task Workflow | Workflow Proerties | options

Allan:

Thanks for the help. The workflow wasn't as intimidating as first
glance. Once I quit looking for the easy way out I finally got it.

I have one other question though - my global variables won't change,
even though the new filename should be something else. I guess when I
was testing, I had in my code (which I've since removed) to rename a
file as my test file to test other parts of the job.

How do you make the global variables refresh each time the job is run?
It should be picking up a new text input file 20050711.CUB on it now,
but it keeps telling me it's the old one 20050707.CUB.

Thanks

BC


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

Default Re: Pass multiple parameters in Execute SQL Task - 07-12-2005 , 04:33 PM



There is a difference between design and runtime. The package saved value
will not change between executions if you open it back up. If you change
the GV val in a run then it is changed for that run and that runonly

--



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


"Blasting Cap" <goober (AT) christian (DOT) net> wrote

Quote:
Allan Mitchell wrote:
You idea about the WHERE and GVs will never AFAIK know work which is why
I suggested using workflow

Right click on a task Workflow | Workflow Proerties | options

Allan:

Thanks for the help. The workflow wasn't as intimidating as first glance.
Once I quit looking for the easy way out I finally got it.

I have one other question though - my global variables won't change, even
though the new filename should be something else. I guess when I was
testing, I had in my code (which I've since removed) to rename a file as
my test file to test other parts of the job.

How do you make the global variables refresh each time the job is run? It
should be picking up a new text input file 20050711.CUB on it now, but it
keeps telling me it's the old one 20050707.CUB.

Thanks

BC



Reply With Quote
  #5  
Old   
Blasting Cap
 
Posts: n/a

Default Re: Pass multiple parameters in Execute SQL Task - 07-13-2005 , 07:38 AM



Allan Mitchell wrote:
Quote:
There is a difference between design and runtime. The package saved value
will not change between executions if you open it back up. If you change
the GV val in a run then it is changed for that run and that runonly

If I understand correctly, if I go ahead & schedule this dts job and
stick it in the batch process, it'll run with the correct date and
everything; but if I open it up in design mode, it'll revert back to the
info I had in the global variables when I developed it. Is this correct?

Thanks again for the assistance.

BC


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

Default Re: Pass multiple parameters in Execute SQL Task - 07-13-2005 , 02:07 PM



Correct. What you see when you open the package back up will be the design
time values but if you are changing them at runtime then the runtime values
will be valid on that run

--



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


"Blasting Cap" <goober (AT) christian (DOT) net> wrote

Quote:
Allan Mitchell wrote:
There is a difference between design and runtime. The package saved
value will not change between executions if you open it back up. If you
change the GV val in a run then it is changed for that run and that
runonly


If I understand correctly, if I go ahead & schedule this dts job and stick
it in the batch process, it'll run with the correct date and everything;
but if I open it up in design mode, it'll revert back to the info I had in
the global variables when I developed it. Is this correct?

Thanks again for the assistance.

BC



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.