Recently, I was in a situation where I had to move data from an old version of a database to a newer version of the same database. The structure of the database had changed slightly. I was trying to figure out what data to move first. I wanted to move data that was referenced before […]
Finding tables and columns in a database
Sometimes you want to find out where a table or a column is referenced in a database. I found this script that does just that.
Multiple Nulls in a column with a UNIQUE constraint
I came accross a situation where I needed to temporarily insert multiple rows in a table with a Null value in a column with a UNIQUE constraint on it. In other words, I wanted the values in that column to be unique, except when they are Null. According to ANSI SQL specifications, this should be […]
Comparing IDENTs in two versions of a database
For the past few days, I have been working on the new version of a database. The database was in development and had to go in production. Of course, the right structure and lookup tables data was in the development version of the database and the good data was in the old production database. Both […]
How to insert into the PK column when it is an auto-number
Normally, trying to insert data into an identity column (autoincremental column) results in an error message. However, there are cases when we need to do this, and using SET IDENTITY_INERT, it is possible. Here is how: SET IDENTITY_INSERT MyTable ON INSERT INTO MyTable(MyTableId, …) VALUES (42, …) SET IDENTITY_INSERT MyTable OFF Here is the message […]
I got my PPA Int’l eSata ExpressCard
After the misadventure with my nGear eSata EpressCard, I returned it, and I ordered a PPA Int’l eSata ExpressCard. This card uses the JMicron chipset and thus was recognized automatically by my MacBook Pro (OS X v10.5.5). It was not easy to find an ExpressCard with that chipset in Canada. Of course, it would have […]
How to compare dates without taking the time into account
Today, I had to fix a bug in a stored procedure that was not handling dates correctly. A date column was being compared to the current date. However, the current date also contains hour, minute and second values whereas the time part of the date column always contained 00:00:00. In other words, we did not […]
How to sumbit a form using the Enter Key on an ASP.Net page
I am working on an application that has a search page with two buttons: one to reset the form and the other one to submit the form. The reset button also clears information kept in session. By default, the Search button has the focus on that page, but has soon as we would click on […]
The nGear eSata ExpressCard freezes my MBP
The nGear eSata ExpressCard froze my Macbook Pro twice. And because my laptop froze, a partition even got corrupted on my external drive. Not very safe for my backups!
nGear eSata ExpressCard uses the Sil3132 chipset
Well, well, despite what the tech. support guy from nGear told me, there eSata ExpressCard is not using the JMB360 chipset but rather the Sil3132 chipset which I wanted to avoid. In fact, when I talked to the guy, he did not know off hand, so he checked the drivers supplied with the card. As […]