Showing posts with label included. Show all posts
Showing posts with label included. Show all posts

Wednesday, March 28, 2012

Scripter and Database Mail

I currently have VB.Net program that scripts out all objects in a server for DR purposes. I just realized that I don't have DB Mail included. I have not been able to find a way to use the Scripter for this. Does anyone know if the Scripter can do DB Mail or will I need to resort to writing queries?

Hi greenie,

DB Mail objects cannot be scripted via Scripter class. We're looking into adding this functionality in a future release.

|||Thanks - I would certainly appreciate the functionality given the DB Mail configuration can get fairly complex. I guess my workaround will be to query the tables and output to my recovery file

Scripter and Database Mail

I currently have VB.Net program that scripts out all objects in a server for DR purposes. I just realized that I don't have DB Mail included. I have not been able to find a way to use the Scripter for this. Does anyone know if the Scripter can do DB Mail or will I need to resort to writing queries?

Hi greenie,

DB Mail objects cannot be scripted via Scripter class. We're looking into adding this functionality in a future release.

|||Thanks - I would certainly appreciate the functionality given the DB Mail configuration can get fairly complex. I guess my workaround will be to query the tables and output to my recovery filesql

Wednesday, March 21, 2012

Script Task Not Updating Package Variable

I am trying to update a package variable. The package consists only of a script task and a package user variable. I have included the variable, myVar (scope: package; type: string), in the ReadWriteVariables property of the script task.

The only code I have used, in Public Sub Main, is:

Dts.Variables("myVar").Value = "2"

The package runs successfully but the variable does not change. I thought that maybe the underlying value really does change even though the value as seen in the package variables window does not (I tested this in another package/solution but it does not seem to - not even during runtime).

I also tried running the variabledispenser method but this resulted in the package running continuously until I stop debugging.

Any suggestions greatly appreciated.

Regards,

Puzzled Again

Hi, Create a local (within script) variable that is a copy pacakge. The following is how I populate a variable in a parent package(failflag), from a variable in a child package(childfailvalue). This script in the child package.

Dim localfailflag As Variable = Dts.Variables("failflag")
Dim localchildfailvalue As Variable = Dts.Variables("childfailvalue")
localfailflag.Value = localchildfailvalue.Value

|||

Thanks Craig. I tried your code but it didn't work...probably because I didn't include other parts of code that were required.

I changed the routine to using an Execute SQL Task to update the package variable and this seems to have worked.

Regards,

Puz