The DTEXEC /DECRYPT option

Today’s lesson is about how to avoid those annoying messages that SSIS gives you about being unable to decrypt sensitive data in a package.

I typically run SSIS packages from batch files using the DTEXEC tool.  That’s probably not the optimal way to run them, but where I work it’s safer than leaving them in the hands of the database administrators.  The packages run fine, but I kept getting errors saying that sensitive data could not be decrypted from the package.  It wasn’t a fatal error, mind you: I put the production database connections in a separate configuration file, so the package ran despite the errors.  (Which makes one wonder why it’s an “error” and not just a “warning,” but that’s another topic.)

First, some background for those that may know this.  For some reason, Microsoft felt the need to control all of the database passwords in the universe.  They did this by encrypting all “sensitive” data (like database connection passwords) in the SSIS package when you save it.  There does not seem to be a way to disable this feature.

By default, SSIS encrypts sensitive data in the package with your Windows user information, so it will only decrypt and work for you.  That’s great if you are the only person who will ever look at, modify, or run your packages.  Unfortunately, in the real world, we often have to give our SSIS package to someone else to run on a production server.  Or perhaps another programmer will want to load your package to modify it.  If you’ve encrypted your package with the default setting, however, anyone else who tries to load it will get a message that sensitive data cannot be decrypted, and they will have to re-enter all the passwords in the package.

One way to get around this is to set your package to encrypt sensitive information using a Package Password.  This is set in the properties of the SSIS Designer.  After you save a package with a password, anyone can open and modify the package without having to re-enter all the database passwords.  They just have to know the package password.  (A team-wide default password should be decided upon.)

That solves the problem of sharing your package between multiple programmers, but what about those pesky error messages we were talking about before?  Simple:  Add ”/DECRYPT password” to the DTEXEC command line parameters and the errors go away.

dtexec /FILE “MyPackage.dtsx” /DECRYPT password /CONFIGFILE “MyPackage.dtsConfig”

Much more information on the DTEXEC utility can be found on MSDN.

The Chocolate Jesus

I hope all the people who keep saying that Muslims are the only ones who freak out when people offend their religion are taking note of incidents like this. Oh, but there weren’t any riots, burnings, or killings, people will say. The end result is the same, though: Intimidation of minorities and stifling free thought.

P.S. I can understand people being upset about religious art displays involving elephant dung and urine, but chocolate??

Escaping {{Braces}} For String.Format

Amazingly enough, I hadn’t run across this situation before.  I was writing a quick utility to generate a C# class from a database table today, and I discovered that the following code failed:

Console.WriteLine( "get { return {0}; }", privatePropertyName );

The string formatter was attempting to parse all of the braces, and it obviously didn’t understand what to do with the first and last one.  Doh!  Hadn’t seen that one before.  But no problem, I thought.  I’ll just draw upon my vast experience and escape them with backslashes, like this:

Console.WriteLine( "get \{ return {0}; \}", privatePropertyName );

Bzzt.  Wrong.  Some hunting on MSDN revealed that you actually need to escape braces in .NET formatted strings by using {{ and }}.  It was definitely a forehead-smacking moment.

Console.WriteLine( "get {{ return {0}; }}", privatePropertyName );

P.S.  Interestingly, the following works as expected:

Console.WriteLine( "get { return 0; }" );

Live and learn.

Looking Back: PopFuncs

I thought it might be fun to review some of my earlier programming projects on this blog.

One of the first “major” applications I wrote for the Amiga was a utility program called PopFuncs, some time around 1988 (amazingly, I had just graduated from high school a year earlier).  All this program did was sit in the background waiting for you to press a function key, at which time it would run a macro that performed some kind of action, like run a program or type some characters on the screen or minimize a window or something like that.  It also had a built-in screen blanker.  It was not the first of its kind for the Amiga, but I felt it had a uniquely easy user interface.

Version 1.0 of PopFuncs was initially written in C.  At some point, however, the floppy disk (you read that right) on which the source code was stored became corrupt, and I lost the entire program.  I then decided to re-write the program from scratch in 68000 assembly language and call it Version 2.  (Early on, I jokingly referred to version 2 as “Lazarus Funky,” because it was a function key program that had come back from the dead.)  I chose assembly language because I had not been happy with the speed and size of the first version of PopFuncs.  Here is what I wrote back then on the subject:

“I was shooting for about 7K when I started this thing, but it quickly grew when I started adding additional features. The entire thing is written in Assembly, so it’s not as big as it could be. (Actually, my first version was written with Lattice C, and with only half the features it was 29K. Fortunately, the disk it was on corrupted and I had to rewrite the thing in assembly. That’s why this is 2.1 instead of 1.1)”

It should be noted that when I wrote “it quickly grew,” I meant that the PopFuncs 2.1 executable size grew to a whopping 16K.  (“Lattice,” by the way, was the name of the company that wrote the Amiga’s most popular C compiler.  The company was later bought by SAS Institute.)

Young programmers are probably wondering why the obsession with executable size.  Grizzled veterans already know this, but back in 1988, most home computers did not have hard drives, and an Amiga floppy disk only held around 800K of data (or something ridiculously small like that).  Anyway, since there was no hard drive, most of the operating system software (not including the 512K Kickstart ROM) had to be stored on the floppy disk!  Of course, back in those days, an operating system was actually an operating system, not an operating system with a thousand extra built-in applications.  The point being that you could actually fit an operating system onto a floppy disk, with room to spare.  But space was still obviously at a premium, so if you wanted a user to put your software on his boot floppy, it needed to have a pretty small footprint.

When I looked into the assembly source code for PopFuncs 2, I fully expected to find hideously ugly code written by an ignorant teenaged programmer.  I was pleasantly surprised to find that it wasn’t all that bad–I actually documented what each function did, more or less, and I inserted useful comments throughout the code.  The following is a verbatim copy of one function: 

* Move the current active window to the back (as if user had clicked the
* window to back gadget).  This only works if the window has a window to
* back gadget.

window_to_back:
                push    d0/a0

                bsr     open_int

                bsr     get_active_window
                bcs     wtb_exit

* Got window address in a0, find out if it has a window to back gadget.

                move.l  wd_Flags(a0),d0
                andi.l  #WINDOWDEPTH,d0         ; depth gadget?
                beq     wtb_exit                ; no, can't depth arrange

* Now simply push the window to the back.

                int     WindowToBack            ; depth arrange it

wtb_exit:       bsr     close_int
                pop     d0/a0
                rts

While not terrible, it could still use some work.  The function names (aka. subroutine address labels) are pretty obtuse (“open_int”?  Only a former Amiga programmer would know that means “open the Intuition library”), and the “int” macro name is not very good, either.  I always try to start functions and methods with a verb now, so it probably should have been “CALLINT,” perhaps in upper case to distinguish it as an assembler macro and not a 68000 instruction.

But if I were assigned to maintain that code, I wouldn’t have too much problem understanding what it does.  Maybe I’m a little biased, though, since I did write it in the first place.  (But then I’ve seen plenty of my old code that doesn’t make a bit of sense to me now.)  I’d have to brush up on the 68000 instruction set again, though.

I was also struck by my program documentation.  First of all, it had documentation, which right off the bat is pretty unusual for a rookie programmer.  Second, the manual was actually pretty informative.  It wasn’t Shakespeare, but it wasn’t bad, either:  It was concise but clear (although it turned out I never explained what the program actually did).  I noted that my technical writing style has not changed very much in the last fifteen or so years.  I’m not sure if that’s good or bad.

Writing small utilities like PopFuncs was widely done by early Amiga programmers.  I actually tried to make a little money with it, too.  After I declared PopFuncs 2.1 “finished,” I made a stack of install disks with neat, dot-matrix labels, had a bunch of copies of the (again, dot-matrix) manual printed at the local Kinkos, and took them to a local Amiga user group meeting.  I sold a handful of them for $10 each I think.  That was my first professional programming gig. :)  It was sort of like a kid’s lemonade stand.  It’s too bad you can’t do that kind of thing any more.

Gosh, I sound old.

Back to the topic at hand.  PopFuncs would later evolve into a version 3, but it was never released in that form, if memory serves.  A fellow in Florida downloaded PopFuncs from a bulletin board (remember those?) and contacted me about including PopFuncs in a commercial package he was putting together, but that deal never came to fruition, and PopFuncs development stalled.  It was my first experience with “business type people” trying to take advantage of my programming talent, a dubious practice which seems almost universal in the technology field.  I eventually abandoned PopFuncs and created a whole new program called KeyMax, which was a greatly enhanced and expanded macro utility.

While digging around the PopFuncs development floppy disks (now stored on CD), I was surprised to find out that I had written a fairly comprehensive document laying out my design goals for PopFuncs 3.  Today, it’s not at all unusual for me to sit down and spend some time planning out my software before I dive into it, but young programmers (me included) almost never do that.  They usually just start coding at some random beginning point and go wherever The Muse takes them.  Let that be a lesson to any young programmers reading this:  Take some time to make a plan.  And no, I don’t mean flowcharts.  Personally I’ve always liked the idea of writing the user documentation before writing the program, although I admit I’ve never fully done that.  I usually just sketch out the highlights.  Trust me, your code will always be better for it.

Overall, I’d give PopFuncs a surprisingly good code review.  Good job, young Tom!

Has Windows Jumped The Shark?

I used to be the kind of person to upgrade software immediately as soon as new versions were available, because it used to be true that upgrades meant there would be some kind of improvement. But lately Microsoft has been working to redefine the term “software upgrade” to mean “an entirely different application rewritten from the ground up without any quality control.” First there was Visual Studio 2005, which is definitely quirkier and slower than Visual Studio 2003. Then, in the same vein, there’s SQL Server Business Intelligence Studio, which I’ve had the pleasure of using for a year now. It has one of the slowest and buggiest interfaces in a Microsoft product I’ve ever seen. How is it even possible that the faster the computer hardware gets, the slower the applications run?

Now there’s Windows Vista. I have not heard a single good thing about Vista (not counting programmers excited about something new to program for). I just talked to someone over the weekend who bought a new computer with Vista installed on it and now he can’t run any of his old software. Today I found this Slashdot article describing hideously slow copy and delete functionality in Vista. An OS that can’t copy and delete files efficiently?? I can only assume it’s because they are trying to ensure that you aren’t copying digitally-protected media content. It really makes me wonder if it’s not time to seriously look at Linux again or maybe even AppleOS. Hell, even AmigaOS might be an improvement at this point. 🙂

Don’t Forget About Iran

Seemingly lost in the midst of Gonzales-gate is the recent abduction of 15 British sailors by Iran. Iran claims the British were in Iranian territory, while the British and Iraq claim they were in Iraqi waters. (Not to scare anyone, but the incident sounds vaguely reminiscent of the impressment of American sailors by the British which eventually led to the War of 1812. At least Iran isn’t making the British sailors serve in their navy.)

Also lost is the news that Iran is thumbing its nose at the United Nations again by refusing to cooperate with UN sanctions against its nuclear program. Incredibly, Iran is saying their nuclear program should be monitored by the International Atomic Energy Agency (IAEA), not the Security Council. They seem to be counting on world-wide short-term memory loss, because it was not long ago that Iran kicked out IAEA inspectors, too. To my knowledge, they have never cooperated with the IAEA, which is one reason literally every civilized nation on the planet thinks they’re trying to make nuclear bombs.

Speaking of Iran and the IAEA, I just found that the IAEA has a page devoted exclusively to news related to their dealings with Iran. I don’t see an RSS feed, though, which makes it largely useless to me.

Bush Scandals Need Help

I’ve been meaning to write about this for ages. As dramatic political scandals go, I have to say that the Bush administration is falling far short of the entertainment goals established by the Clinton administration.

During the Scooter Libby trial, I tried really hard to pay attention while Hardball’s David Schuster breathlessly reported all of what were clearly supposed to be exciting details of the ongoing trial, but all I could manage to hear was something like this: “Today’s dramatic testimony came from none other than blah blah blah blah and he/she/they dropped the previously undisclosed shocking bombshell that blah blah blah blah blah!” I found myself much more fascinated by the fact that on the constantly repeating onscreen video, Scooter Libby’s wife looked disturbingly like Michael Jackson. In the end, all of the courtroom drama resulted in a handful of convictions for telling some fibs to the prosecutors. Wow, ahem, I hope he doesn’t get the chair.

Now we’ve got Alberto Gonzales and the firing of eight lawyers. It’s like I’ve always said: Nothing makes for a more exciting scandal than the operation of the human resources department in a government agency! To make it more interesting, it’s been morphed into a “showdown” between the executive branch and the legislative branch. It hasn’t been said out loud, but it’s been strongly implied that the future of American government as we know it might be on the line here.

As a side note, on this particular issue, I tend to agree with Bush not allowing Rove to testify publicly. I happen to think that full government transparency isn’t necessarily be a good thing for the country. Plus, you know that as soon as Rove is under oath in front of the cameras, every single Democratic senator is going to start badgering him about Scooter Libby, Jim Wilson, and Valerie Plame. I say let it go already; quit living in the past. We all know Rove was behind the leak, and he’s probably behind everything in some way or another, but there’s absolutely no proof of it so let’s start spending our tax dollars on something else. Like, you know, maybe keeping Iran from blowing up the world.

My point with all of this is to say that, as a taxpayer, I’m not happy about having to keep up with these complicated legal proceedings. For the next Bush administration scandal, I would like to request that somebody die in the Caribbean. I think that would make the resulting political theatre much easier to follow.

Blog Test Weekend Results

As of 10:00 PM on Sunday, I’ve received 2,286 hits on the new blog from Yahoo’s and Google’s search engines. Kind of amazing that my little ol’ domain gets that much traffic.

I think I’m just going to leave it running this week. Cynthia helped me fine-tune the comment feature a little bit during the test period, and everything else seems to be working alright.

Blog Test Weekend

I am conducting a test this weekend. I’m replacing the old uvPortal software with the new uvBlog software to see what happens. Mainly I am testing to see if I can divert traffic that used to go to the portal to the new site. I will probably switch it back at the end of the weekend and spend some time analyzing the results before making my next move.