SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Package to Script All SQL Server Jobs to Individual Files


SSIS Package to Script All SQL Server Jobs to Individual Files

Author
Message
SQL Doc
SQL Doc
Old Hand
Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)

Group: General Forum Members
Points: 352 Visits: 436
For a sql server login I can not think of a way. The AcquireConnection method requires that the connection object have a connection string. Doing encryption is really not that hard try something like this
[url=http://www.databasejournal.com/scripts/article.php/1496441/Enhanced-RC4-EncryptionDecryption-Script.htm][/url]

Just name the function something weird.

Good luck

Thomas Lane, PhD
DBA
Edgenet / Big Hammer Data
SQL Lane
Kenneth Fisher
Kenneth Fisher
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12279 Visits: 2121
I did in fact just find a solution. It turns out the AcquireConnection method of a SMO connection is an SMO Server, so I was able to use the following code.


Dim src As Server
src = DirectCast(Dts.Connections("SMOSOURCE").AcquireConnection(Dts.Transaction), _
Server)



I have actually done some encryption with SQL Server and would probably have gone that way at need. I just prefer this way because I can let the connection manager handle everything, and it just seems more neatly handled this way.

Thanks
Kenneth

Kenneth Fisher
I was once offered a wizards hat but it got in the way of my dunce cap.
--------------------------------------------------------------------------------
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/Link to my Blog Post --> www.SQLStudies.com
ken.trock
ken.trock
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2706 Visits: 1737
Tom, thanks for sharing this. Not sure what you did to prevent that annoying @schedule_uid from appearing in the new job (which would cause it not to compile) but I'm glad it's out.

This saved me some time when trying to script out 30 cloned jobs on a new machine. And now I have a backup of the jobs :-D

Ken
SQL Doc
SQL Doc
Old Hand
Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)Old Hand (352 reputation)

Group: General Forum Members
Points: 352 Visits: 436
Your wish is my command. This should comment out the schedule_uid parts.

Thomas Lane, PhD
DBA
Edgenet / Big Hammer Data
SQL Lane
Attachments
ScriptJobs.zip (29 views, 14.00 KB)
gkcajucom
gkcajucom
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 3
Thanks for saving me a lot of time! It worked for me!
andrewkane17
andrewkane17
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4099 Visits: 3329
Just what I needed, thanks.



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search