dbTalk Databases Forums  

DTS Globial Variables &

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


Discuss DTS Globial Variables & in the microsoft.public.sqlserver.dts forum.



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

Default DTS Globial Variables & - 06-19-2006 , 10:39 AM






In have a DTS package involving Batch files, ActiveX vbs scripts, an
Access2000 databases and SQL Server Database. At the end of the package, I'm
using an 'Execute SQL Task' to create an email using XP_sendmail to notify
users that the access data base has been updated. Everything thing works
fine. Now, I would like to change the body of the message to include how
many records in the Access database were actually added. I'm having a
problem accessing the DTSGlobalVariables in the 'Execute SQL Task' which
seems like a logical place to hold a simple value of how many records were
added to a Access database in an eariler process. Any suggestions. Thanks
in advance.

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

Default Re: DTS Globial Variables & - 06-19-2006 , 01:30 PM






Hello Bill,

So you may want to grab the amount of rows that were moved by assigning the
result of RowsInError/RowsComplete

http://doc.ddart.net/mssql/sql2000/h...ropmr_05wp.htm

to a Global variable

How are you assigning the values in the ExecuteSQL task.

Maybe using this article would be easier?

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


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
In have a DTS package involving Batch files, ActiveX vbs scripts, an
Access2000 databases and SQL Server Database. At the end of the
package, I'm using an 'Execute SQL Task' to create an email using
XP_sendmail to notify users that the access data base has been
updated. Everything thing works fine. Now, I would like to change
the body of the message to include how many records in the Access
database were actually added. I'm having a problem accessing the
DTSGlobalVariables in the 'Execute SQL Task' which seems like a
logical place to hold a simple value of how many records were added to
a Access database in an eariler process. Any suggestions. Thanks in
advance.




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

Default Re: DTS Globial Variables & - 06-19-2006 , 06:29 PM



Hi Allan,

Right now, my DTS package has a 'Execute SQL Task' with the following code:


DECLARE @BodyMessage varchar(100)
SET @BodyMessage = 'Number of Records Loaded: ' +
DTSGlobalVariables("iRecordCount").Value

EXEC xp_sendmail @recipients ='joe.smith',
@message = @BodyMessage,
@subject = 'New Records Loaded'


I realize I could just excute a direct SQL statement to the Access database
(and may end up doing that), but was hoping to use the DTSGlobalVariables,
which seems to be a more simple solution.




"Allan Mitchell" wrote:

Quote:
Hello Bill,

So you may want to grab the amount of rows that were moved by assigning the
result of RowsInError/RowsComplete

http://doc.ddart.net/mssql/sql2000/h...ropmr_05wp.htm

to a Global variable

How are you assigning the values in the ExecuteSQL task.

Maybe using this article would be easier?

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


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

In have a DTS package involving Batch files, ActiveX vbs scripts, an
Access2000 databases and SQL Server Database. At the end of the
package, I'm using an 'Execute SQL Task' to create an email using
XP_sendmail to notify users that the access data base has been
updated. Everything thing works fine. Now, I would like to change
the body of the message to include how many records in the Access
database were actually added. I'm having a problem accessing the
DTSGlobalVariables in the 'Execute SQL Task' which seems like a
logical place to hold a simple value of how many records were added to
a Access database in an eariler process. Any suggestions. Thanks in
advance.





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

Default Re: DTS Globial Variables & - 06-20-2006 , 01:10 PM



Hello Bill,

You cannot use the GV in this way.

The article I posted from your site could be your best way of doing this.
The way you substitute parameters into statements is to place a ? in the
statement and then press the Parameters button and then map a GV to the parameter.

I still would favour the Article though because the design time is not particularly
robust.


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hi Allan,

Right now, my DTS package has a 'Execute SQL Task' with the following
code:

DECLARE @BodyMessage varchar(100)
SET @BodyMessage = 'Number of Records Loaded: ' +
DTSGlobalVariables("iRecordCount").Value
EXEC xp_sendmail @recipients ='joe.smith',
@message = @BodyMessage,
@subject = 'New Records Loaded'
I realize I could just excute a direct SQL statement to the Access
database (and may end up doing that), but was hoping to use the
DTSGlobalVariables, which seems to be a more simple solution.

"Allan Mitchell" wrote:

Hello Bill,

So you may want to grab the amount of rows that were moved by
assigning the result of RowsInError/RowsComplete

http://doc.ddart.net/mssql/sql2000/h...ropmr_05wp.htm

to a Global variable

How are you assigning the values in the ExecuteSQL task.

Maybe using this article would be easier?

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)
Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com
In have a DTS package involving Batch files, ActiveX vbs scripts, an
Access2000 databases and SQL Server Database. At the end of the
package, I'm using an 'Execute SQL Task' to create an email using
XP_sendmail to notify users that the access data base has been
updated. Everything thing works fine. Now, I would like to change
the body of the message to include how many records in the Access
database were actually added. I'm having a problem accessing the
DTSGlobalVariables in the 'Execute SQL Task' which seems like a
logical place to hold a simple value of how many records were added
to a Access database in an eariler process. Any suggestions.
Thanks in advance.




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.