March 2005 - Posts

For the first time, comments off...

I got bombarded with maybe 20 comment SPAMs in the last 24 hours, a couple of which were so large that they locked up .TEXT while I tried to delete them. So I'm going to turn comments off for a while in hopes that these bastards go away.

Hopefully Donny will finish up the Community Server upgrade soon so that we can leave this all behind. I am so sick of dealing with this stuff...

SQL to duplicate 1000 monkeys with 1000 typewriters

Louis Davidson posed a question a couple of months ago on his blog that I just found: How long would it really take those 1000 monkeys with 1000 typewriters to write the world's greatest literature?

He then goes on to (sort of) answer the question -- using TSQL. So the new question is: How long would it take for 1000 servers running SQL Server to write a book on SQL Server?

...And more importantly, would that book be finished before SQL Server 2005 is released?

Celko on SQL CLR: "database design is a totally different skill from application development"

More fun CLR conversation, this time from SQL advocate Joe Celko.

Surprise, surprise, Celko is not a big fan of CLR integration. Yet he mentions the SQL/PSM standard as a better alternative, even though it has the same issues he mentions. But it's open-source (Java-based), so it must be better. Right?

Why is the CLR integration getting so much attention? Oracle, DB2, PostgreSQL, and other DBMSs have had these kinds of features for a long time. Where was Celko when those were being added? Why argue with Microsoft now? And how much damage has been done by the inclusion of these features in those database systems?

That said, I do agree with a lot of what Celko has to say; application developers will be able to do a lot of damage with these features, if DBAs let them. If management lets them. If they don't get appropriate training. These are all very valid points. Watch this space in the coming months for a lot of discussion on best practices for using these new tools. I think that MS marketing has taken things too far (see my post from yesterday on the related topic of "CLR replacing T-SQL"), but at the same time I do believe these tools have their place and with very careful use will prove to be extremely valuable.

I think it's time for DBAs to accept the fact that they're not going to be able to get by any longer as just database geeks. Learn about application architectures. Learn how and why applications are using your databases. And most importantly, learn enough to argue with the application developers who might otherwise bring ruin to your pristine database systems. But do not, like Celko, fear change. Instead, learn how to wisely integrate these new tools into your arsenel.

James Hamilton on SQL CLR: "...you can write in any language now."

Tom Rizzo pointed out the other day that he and James Hamilton were featured on The .NET Show, discussing SQL Server 2005.

This was a pretty interesting show, and I recommend that readers interested in SQL 2005 features watch the webcast.

However, one quote in particular annoyed me. From James Hamilton, about CLR stored procedures:

"You're no longer forced to use T-SQL. T-SQL's absolutely still supported. Works as well as ever. But you can write in any language now."

I'm utterly sick of hearing this absolutely baseless claim repeated over and over by people both inside and outside of Microsoft! I'd originally heard it from a certain MS evangelist (name withheld to protect the guilty!) over two years ago, and believed it until I first cracked open the SQL Server 2005 Books Online.

The bottom line is, at least as of the current beta -- and according to everything I've read about the SQL CLR integration -- you MUST USE T-SQL TO ACCESS DATA. When coding a CLR stored procedure, the only way to get data from the database is to use a context connection back and execute a T-SQL query. There is no replacement for T-SQL. And you certainly cannot code data access in "any language".

I don't know why this claim keeps getting repeated. I just want to set the record straight, at least for readers of this blog. Unless MS has a huge secret change lined up that hasn't hit the beta yet, this is just how it is. So please, MS and others, stop making this claim! To me it feels like little more than a sad marketing tactic that's gone way too far.

Run Profiler as non-admin

Via Tara: This forum post shows a method of setting up access to Profiler without granting sysadmin access.

It's not perfect -- a network trace or possibly hex-editing the executable will give up the password. But it's at least somewhat better than giving sysadmin access to every member of a development team, just so Profiler can be run (as I've had to do on multiple occasions).

DevTeach 2005

My next confirmed speaking gig is at the DevTeach 2005 conference in Montreal, June 18-22. This looks like it's going to be an excellent conference. Check out the speakers list here. Lots of names I recognize, and some very interesting sessions planned!

I'll be giving three talks. Two talks that I debuted at Code Camp III (SQL Server 2005 Relational Engine Enhancements, Best Practices for Structured Development with SQL Server) and a new talk that I'm developing, a code-driven introduction to SQL Server Notification Services.

It should be a good time, and Montreal is an awesome city to visit, especially in summer when it's not frigid! So I'm definitely looking forward to this one!

Introducing: TSQLAssert

Yes, yet another introduction (although there was almost zero reaction to yesterday's introduction).

Today, I introduce the first thing built on top of TSQLMacro. I proudly present the TSQLAssert debug assertion framework!

For those of you who've worked with assertions before, I think you'll enjoy this quite a bit. It provides similar functionality to assertions in other languages, and I think it will be great for debugging and perhaps as an addition to environments using TSQLUnit.

For those of you who haven't felt the joy that is asserting in your code, check out the following intro in the Wikipedia: http://en.wikipedia.org/wiki/Assertion_%28computing%29

As always, feedback is appreciated! Thank you!

Introducing: TSQLMacro

I am pleased to announce the official introduction of the TSQLMacro framework, version 0.5 (prebeta-1). This version is functionally complete based on the initial design spec, features are stable, and I am not currently aware of any bugs.

So what is TSQLMacro? You can get a complete rundown here. But in essence, TSQLMacro is my attempt to bring C/C++-style macro and preprocessor support into TSQL, in order to ease certain development burdens. Please read the TSQLMacro Introduction for a detailed analysis of those issues.

And of course, there's a download page. But I highly recommend reading up before downloading -- I haven't yet included a readme or any other kind of documentation in the download.

As always -- and especially, in this case -- I would appreciate any comments, feedback, suggestions, rants, or other things you'd like to tell me about this project! I've spent a huge amount of time -- way too much time -- working on this, so I'm eager to see what people think! Thanks!

Code Camp 3 wrapup

Thanks again to Thom Robbins for giving me the opportunity to talk at this weekend's New England Code Camp! I had a great time and got hit with some very interesting questions.

I didn't manage to make it through too many complete sessions, as I wanted to catch a glimpse of a variety of topics. Highlights were some interesting new Visual Studio 2005 features from Richard Hale Shaw, a very good talk on SQL 2005 security from fellow SQLJunkies blogger Robert Hurlbut, and an especially intriguing talk on Microsoft search technologies delivered by SQL Server MVP and replication guru Hilary Cotter.

To those who attended my talk on SQL Server development best practices: I am very, very close to completing the promised documentation and will officially launch the website sometime in the next two days. So please check back. And thanks again for attening my session!

Yet another string splitting UDF: Tokenize

Yes, more string splitting UDFs. Good times!

This one will let you split strings a very special way: It keeps track of substrings within the string, delimited by apostrophes.

As always, I'd appreciate any comments if you enjoyed it, were insulted by it, found some bugs in it, or just needed someone to talk to.

I heard there's a new CTP!!!11!!1!!!!111!!!1111!!!!!!

I just couldn't resist, since every other blogger on this site reported the same thing...

But here's an annoyance: The unified CLR provider does NOT appear in this CTP -- so I probably won't even bother installing it. I'm still working with the October CTP, which is quite stable for my needs...

IBM plays catchup -- again?

Okay, this is getting sad. After I announced IBM's last ploy to catch DB2 up to what Yukon is going to offer (a very low level of hosted CLR support), this comes along... The operative "this" being a copy of DB2 Magazine, which I've strangely been subscribed to. I don't know why I'm subscribed -- I'm also suddenly subscribed to Stuff Magazine and ESPN Magazine, neither of which I signed up for.

But that's not important. What is important is this headline on page 10:

DB2 Goes Native
A small group of DB2 customers are trying out early code for a hybrid DB2 database that handles both native relational and native XML data. DB2 currently stores XML structures and data in a single column or as a collection of data in multiple columns and tables. A hybrid database would allow XML-based queries against the XML and relational data stored in DB2. The XML data is stored and managed without being forced (or shredded) into a relational format. Both SQL and XQuery will be supported to query the relational and the XML information.

A general beta test is planned for later this year.

Getting scared, IBM?