dbTalk Databases Forums  

Need Simple Walk-Thru Code Sample

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


Discuss Need Simple Walk-Thru Code Sample in the microsoft.public.sqlserver.dts forum.



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

Default Need Simple Walk-Thru Code Sample - 12-09-2004 , 01:17 PM






Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks

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

Default Re: Need Simple Walk-Thru Code Sample - 12-09-2004 , 01:35 PM






You have provided scant information for us with which to work..

www.SQLDTS.com has a raft of code samples for you.

Have a look here

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Quote:
Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks



Reply With Quote
  #3  
Old   
Jamie Carper
 
Posts: n/a

Default Re: Need Simple Walk-Thru Code Sample - 12-09-2004 , 02:49 PM



Maybe I am not getting it...

I tried searching for an example on your site first, then on the MSDN site.
I am not turning up anything useful at this time.

I thought I made my requirements clear. But I will explain again.

1 - I have an ActiveX Scipt object
2 - I have a SQL Task object
3 - Within the Script object I am looping thru some recursive code picking
up locations and names of datafiles in a specified area. I then pass this
info onto another DTS package for importing and processing.
4 - I also wish to log what files I am importing as well as the file dates
into a separate table
5 - To do this I am wanting, at the point in my Script object where I call
the DTS, to additionally Execute the SQL Task object passing it the
discovered Filename and Date
6 - The SQL Task object makes a SQL call to INSERT the log data

I need a simple code example on how to accomplish point 5. I have everything
else up and running (thanks in part to some of your other examples on the
site).

Thanks.

"Allan Mitchell" wrote:

Quote:
You have provided scant information for us with which to work..

www.SQLDTS.com has a raft of code samples for you.

Have a look here

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks




Reply With Quote
  #4  
Old   
Jamie Carper
 
Posts: n/a

Default Re: Need Simple Walk-Thru Code Sample - 12-09-2004 , 04:45 PM



I guess what I am really looking for is a good example of how to call the
"Execute" method of the ExecuteSQLTask object. There are several parameters
listed. I have no clue what they are or what they are for. An example would
open my eyes.

"Allan Mitchell" wrote:

Quote:
You have provided scant information for us with which to work..

www.SQLDTS.com has a raft of code samples for you.

Have a look here

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks




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

Default Re: Need Simple Walk-Thru Code Sample - 12-10-2004 , 12:18 AM



By the sounds of it then you need to loop around until you have finished right?


Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)

How to loop through a global variable Rowset
(http://www.sqldts.com/default.aspx?298)


Your original explanation said you wanted to execute a "SQL Task" (will presume ExecuteSQL task) by passing a value from the active
Script task
Using the article I sent would allow you to do that. Your subsequent explanation is far more detailed and clearer

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Quote:
Maybe I am not getting it...

I tried searching for an example on your site first, then on the MSDN site.
I am not turning up anything useful at this time.

I thought I made my requirements clear. But I will explain again.

1 - I have an ActiveX Scipt object
2 - I have a SQL Task object
3 - Within the Script object I am looping thru some recursive code picking
up locations and names of datafiles in a specified area. I then pass this
info onto another DTS package for importing and processing.
4 - I also wish to log what files I am importing as well as the file dates
into a separate table
5 - To do this I am wanting, at the point in my Script object where I call
the DTS, to additionally Execute the SQL Task object passing it the
discovered Filename and Date
6 - The SQL Task object makes a SQL call to INSERT the log data

I need a simple code example on how to accomplish point 5. I have everything
else up and running (thanks in part to some of your other examples on the
site).

Thanks.

"Allan Mitchell" wrote:

You have provided scant information for us with which to work..

www.SQLDTS.com has a raft of code samples for you.

Have a look here

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote in message
news:E2B370B0-9174-4D22-881D-5BD64D379DBE (AT) microsoft (DOT) com...
Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks






Reply With Quote
  #6  
Old   
Jamie Carper
 
Posts: n/a

Default Re: Need Simple Walk-Thru Code Sample - 12-10-2004 , 09:05 AM



Hi Allan,

I have used that example before. I will look at it again to see if I missed
something.

But no, there is no looping of the DTS process. The only loop occurs within
the ActiveX Script object where I call a function recursively within the VB
Script. That function then calls a second DTS process. While staying within
this recursive loop I need to remotely execute (without using any flow
process) the SQL Task object.

I think I am almost there with the following:

Dim MyPackage
Dim MySQLObject

Set MyPackage = DTSGlobalVariable.Parent
Set MySQLObject = MyPackage.Tasks("DTSTask_DTSExecuteSQLTask_1")

' Later within the recursive code
....

' Here we pass our findings to our global variables which have been mapped
to the parameters of the SQL Task object
DTSGlobalVariables("LoggedFileName").Value = File.Path
DTSGlobalVariables("LoggedFileDate").Value = File.DateLastModified

' This is where things break down, because I do not know what/where the
parameters come from
MySQLObject.Execute ?, ?, ?, ?

....

Is this entirely the wrong approach? Is there a way to redirect the flow to
the SQL object and then return within the recursive code?

Thanks for your input,

Jamie

"Allan Mitchell" wrote:

Quote:
By the sounds of it then you need to loop around until you have finished right?


Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)

How to loop through a global variable Rowset
(http://www.sqldts.com/default.aspx?298)


Your original explanation said you wanted to execute a "SQL Task" (will presume ExecuteSQL task) by passing a value from the active
Script task
Using the article I sent would allow you to do that. Your subsequent explanation is far more detailed and clearer

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Maybe I am not getting it...

I tried searching for an example on your site first, then on the MSDN site.
I am not turning up anything useful at this time.

I thought I made my requirements clear. But I will explain again.

1 - I have an ActiveX Scipt object
2 - I have a SQL Task object
3 - Within the Script object I am looping thru some recursive code picking
up locations and names of datafiles in a specified area. I then pass this
info onto another DTS package for importing and processing.
4 - I also wish to log what files I am importing as well as the file dates
into a separate table
5 - To do this I am wanting, at the point in my Script object where I call
the DTS, to additionally Execute the SQL Task object passing it the
discovered Filename and Date
6 - The SQL Task object makes a SQL call to INSERT the log data

I need a simple code example on how to accomplish point 5. I have everything
else up and running (thanks in part to some of your other examples on the
site).

Thanks.

"Allan Mitchell" wrote:

You have provided scant information for us with which to work..

www.SQLDTS.com has a raft of code samples for you.

Have a look here

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote in message
news:E2B370B0-9174-4D22-881D-5BD64D379DBE (AT) microsoft (DOT) com...
Why cant MS provide simple examples in the DTS help files. I learn much
faster by example?

Can anyone provide me a simple vbscript example of within the ActiveX Script
Object how to Execute an existing SQL Task Object passing it Input Parameters?

I dont have time to make sense of the MS documentation. I need examples.

Thanks







Reply With Quote
  #7  
Old   
Jamie Carper
 
Posts: n/a

Default Re: Need Simple Walk-Thru Code Sample - 12-10-2004 , 09:13 AM



I think I just needed to step back a little and look at the big picture.

I just need to add the logging process to the workflow of my second DTS and
be done with it.

Sorry to have taken up your time.

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.