Andres Aguiar's Weblog

Right here, right now

Stories

January 2007 - Posts

Visual Studio Tools for Database Professionals - Rename Refactoring

I started playing again with VSTDB.

This version only includes on 'Refactoring', the 'Rename' one. The first thing I tried to do was to rename a database column.

There are 3 things to do when doing that refactoring:

  1. Renaming it in the database table. 
  2. Renaming it in every other database object that references it (stored procedures, views, etc).
  3. Renaming it in your Data Access Code

3) was obviously out of the scope of the tool, perhaps they can do it with ADO.NET v.next.

2) works OK

1) This is one seems simple but it's tricky. If you generate migration scripts by comparing two DB schemas, you never know if a column was renamed or if there's a new column and the old one was deleted. That's the first test I do with any tool that claims to do 'database refactorings'. But if the VSTDB team was doing only one refactoring for this version, at least it should be well done. But it's not. When you rename a column you get a nice warning saying "The default script that is generated at deployment time results in dropping the existing table column and adding a new table column with the new name. This can result in data loss. If data must be maintained, please perform data migration manually".

Worse, the script to do that change creates a temporary table, copies the data, and renames the temporary table with the original table name. It does not do an alter table add column/drop column.

I was disappointed.

The 5 Things

Martin pointed at me. These are my 5:

MP3
 
I'm an mp3 freak. I moved for 2 years to Barcelona in 1997 and ripped most of my CD collection, to avoid carrying CDs. At that time my dream was a hardware mp3 player (but I still did not buy an iPod). The first one I bought was a iRiver that played MP3 CDs. Flash players with less than 512MB always felt like useless, but I bought a 128MB for my wife (I'm not saying she's useless, but let's call her 'technically handicapped').  I had 3 MP3 radios, two AIWAs and 1 Pionner. The first AIWA was stolen, the second broke, and the Pioneer was stolen too, so I decided to stop buying radios for thieves. My next purchase was a iAudio with 1GB, just before the iPod Shuffle was released. I liked it because it takes 1 AA battery that takes a long time to drain.  On the other hand, I always knew my ultimate MP3 player would be a phone, so I kept buying cheap cell phones, until I found one that looked good enough, and I settled with a Sony Walkman Phone a couple of months ago. I'm probably doomed to buy my first Apple branded piece of hardware in June. I also have a couple of mp3 capable DVDs and a MediaMVP media player.
 
Computers
 
The first computer I was able to use regularly was a TI 99/A. A friend's father had one and he let me have it at home for long periods. The first one my father bought was an Apple IIe clone. I started programmed professionally using that one. My first real world application was one targeted to Advertisement Agencies, designed to simulate TV advertising ('how much different people will see my add if I place it in these set of shows?'). I still remember how embarrassed I felt when someone looked at my code and read:
 
1010 GOTO 1050: PRINT "Something"
 
(not because GOTO was harmful, but because the PRINT statement looked unnecessary ;)
 
Code Generation
 
Soon after I started programming, I started writing code generation tools, that sucked, but helped me to get started in each new CRUD form. 7 years later, I joined a company that built a code generation tool for living. I started writing a Java generator in 1997, using JDK 1.1.4 and I worked on it until 2001 when we started with DeKlarit. The code generator is written in Prolog, so Prolog is probably the language in which I wrote most my code that is in production today. I don't write much production code now.
 
Family
 
I've been married for 10.5 years, and have two kids, Pablo (6) and Diego (3). I have 2 brothers and 1 sister. 2 of them are also computer geeks.
 
Coins
 
I started collecting coins when I was 9. I kind of continued with it through my whole life but without much passion, but recently I'm back into it, sharing it with my elder son. These days it's quite easy to get a decent amateur collection using Ebay. So, if you are thinking on a birthday present, old coins are always welcome ;).

I'm tagging Gaston, Eugenio, Matias, Andrew, and the author of one of my favorite blogs, swissmiss, but she'll ignore me ;).

 

More Posts