April 11, 2004 at 2:14 am
Hi,
I've created a DTS package which imports data into 21 tables and I have set up "Execute SQL Tasks" to record and e-mail any failure on any individual table.
I would like to build a text message to include in one single e-mail when the package has attempted all table updates.
I.e. on failure @@GlobalVar = @@GlobalVar + 'Table xyz failed'
Can anyone assist please.
Regards,
Ian
April 12, 2004 at 7:15 am
Try this syntax...
DTSGlobalVariables("myGV_Name").Value = myGV_Value
April 12, 2004 at 8:24 am
In addition, you will need to declare the Global Variable(GV), either in your code or at the DTS package level. I would suggest declaring it at the package level.
Open the Package in design view, right click to get to Package Properties, then the second tab in called 'Global Variables' to declare your String variable.
Then, as Bellis (above) notes, use code in your steps to set the value of the GV. hth
April 12, 2004 at 12:26 pm
Thank you to both of you,
Had tried code however I was unable to reference global variable in EXEC SQL tasks.
Seemed a choice between doing everything in code or everything in SQL so (already invested in SQL) I took the SQL route, using one of my stored procedures and a table.field as my "global variable".
Each step adds to "global variable" according to success or failure and at the end (with a few Char(13)s) I dump the field into a single email listing progress and results.
I normally do prefer code so I must get into DTS code sometime.
Again, many thanks.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply