torsdag, september 27, 2007

SQLServer is also stupid

I can't understand the problems database drivers have with whitespace where there shouldn't be any. It's clearly wrong...

So say that you create a table in SQLServer that is nullable. If you use DatabaseMetaData and do getColumns for that table, and check the nullable column, and fetch the value at index 18 - IS_NULLABLE. What you get back here is "YES" which is all according to the API. But if you by chance do the same thing for a column that is non-nullable - what value would you get then?
"NO ". Notice the space. Lovely. I *heart* databases.

... Someone asked me in response to my last blog post which database I would choose if I could. Hard question. I'd rather do without databases. But if I have to, I'd go with Mimer SQL which is probably the most SQL-compliant database ever, and really doesn't have WTF moments at all. It's small, it's from Sweden, and it's very nice.

6 kommentarer:

quark sa...

This smells of char(3) a long way.

Tony sa...

So far, I'm liking what I've seen of CouchDB a lot.

It's not a SQL-driven db, but is certainly adequate for handling many of the tasks for which I use databases. Getting the results back in JSON form will be damned convenient. Having an Erlang shell on the server side is icing on the cake.

Peter Krantz sa...

Mimer looks nice. The only problem I have is that it isn't open source and the price tag is a bit hefty. The free developer version is of course a bonus.

Alex sa...

Back when I worked at MetaMatrix I used to run into this stuff with database metadata all the time. If you look at DatabaseMetaData across any subset of JDBC drivers or even better the ResultSetMetaData, you will find some hilarious differences. It's even worse than the SQL divergence.

Lars Westergren sa...

Peter, that is odd. I know I saw an announcement back in 2004 or so that Mimer was going open source, it was even on Slashdot, but now I can't find anything about it.

Parantar sa...

sometimes sql is so stupid. hehe