Tony Davis

Simple-Talk Editor
News, views and good brews

SQL Server Tumbleweed Awards

Published Tuesday, June 24, 2008 2:35 PM

Several parts of SQL Server look as though they were started and then suddenly abandoned. The classic example is the TEXT datatype. Phil Factor has a theory on most things, and in this case it's that the programmer responsible for implementing the TEXT datatype at Microsoft succumbed to the unbearable pressure of the job, one day, leaping up in his cubicle, throwing off all his clothes, and flinging himself through the window, shouting 'I must join the penguins'. As a memorial to their departed colleague, his sorrowful team left the code in SQL Server at exactly the point it had been abandoned.

 

Anyone who has tried to use the TEXT (or IMAGE) datatype will immediately sympathize with Phil's theory. It has so many restrictions placed on it, and so many quirks, that using it is like training a mule to jump through hoops.

 

Two other examples spring to mind, of features that seem to have been abandoned in mid-development. The first is the SSMS Templates. The macro processor that allows actual values to be substituted for placeholders is valuable, but curiously primitive in its implementation; more like a 'proof of concept' exercise. The datatype field doesn't seem to be used at all, leaving just a crude system of string substitution with no attempt at validation. It is odd that such a useful system has never been developed further.

 

The second is SQLCMD. Anyone who bases a robust scripting system on SQLCMD soon becomes frustrated by its limitations. Why are there so many differences between the commands in the command-line version of the tool and the SSMS 'SQLCMD mode'? Why can't variables be used in expressions? Even the simplest conditional statement is impossible. One cannot perform any operations such as concatenation or simple maths on values within variables.  This is no harder than a second-year undergraduate project.

 

I wonder if the SQL Server product is now so colossal that not even Microsoft's highly-advanced project management techniques can prevent the odd component from falling through the cracks. The TEXT data type has, to general relief, been replaced by VARCHAR(MAX), but the issues with SSMS Templates and SQLCMD remain.

 

Templates provide arguably the first, and best, productivity aid that a database developer should use and yet, under-developed and under-publicized by Microsoft, they remain a mystery to all but a few. SQLCMD is extraordinarily powerful, and many DBAs reach for it rather than SSMS, only to become frustrated by the inconsistencies and weaknesses of its scripting variables.

 

It reminds me of those, somehow elegiac, "work in progress" signs that one sometimes encounters on a remote back road, where no-one seems sure what work was planned or whether it will ever be completed. We encourage your own nominations for Simple-Talk's 'SQL Server TumbleWeed' award. The winning nomination, added as a comment to the editorial blog, will receive a $50 Amazon voucher, and three runners-up will get a Simple-Talk gift pack.

 

Cheers,

 

Tony.

Comments

 

stic said:

Interesting topic indeed, I hope that there will be a lot of examples...

My favourite one, mainly because it will force me to rewrite some logic, is Web Services (SOAP) Support in SQLXML (SQL Server 2000) and it's successor Native XML Web Services (SQL Server 2005). Could you believe that was made deprecated in SQL Server 2008? No? Me too :-]

I was really a fan of SQLXML - it was really great to see Microsoft joining W3C effort and providing almost standard compliant implementation of XQuery or XPath. I was really amazed but even XML data type constrains (with XSD) was working there. When they provided support for WS (SOAP) it was somehow limited - but saved a lot of custom code, while all you need was a simple request / response scenario.
Then the Native XML Web Services was introduced in SQL Server 2005 - more or less the same concept, but done better (closer to database engine, so easier to maintain / configure / deploy). I bet that there are quite a few developers that uses it quite extensively (btw. you probably remember that it was one of the 'killer futures' of 2005? ;-)

And now... it is salsola, tumbleweed... ech... You shall use WCF, ASP.NET instead.
While, of course, all the XML data type hype is still valid ;-)

I've my little theory too... One day all these ex-Rational developers that joined Microsoft, just after Rational was bought by IBM, were forced to work in SQL team - so they did what they can to SOA-enable our precious db server. All this XML/SOAP/XPath/XQuery - that have to be them! Now they probably moved to Entity Framework, or spread their vision somewhere else, as SQL Server 2008 have to be shipped some day soon ;-)))

Regards,
June 25, 2008 3:57 AM
 

thisisfutile said:

UNDO and REDO

I find it hard to believe that when the desiginers were testing SQL 2000 Query Analyzer (and SP2 and SP3 and SP4) that the CTRL+Z and CTRL+Y features were considered adaquate and never entered as an "enhancement issue".

Not only am I limited to a mere 20 undo buffers, these buffers aren't even a true undo as it would be in a any other editor interface in that if I type 20 consecutive characters and then pause, the UNDO would actually remove all 20 characters in and only use ONE undo buffer.  In QA, these 20 consecutive characters take all of my 20 undo buffers.  Furthermore, CTRL+Y doesn't work either...it deletes entire lines of code.  The only other MS products that are worse than this are MS Paint with it's 3 undo limit and Notepad with it's 1 undo limit (however, notepad runs a close race because if I drag my finger across the number keys two times producing 12345678901234567890 and then do a CTRL + Z, these will all be taken out of the editor).
June 25, 2008 11:26 AM
 

Phil Factor said:

I'd like to nominate the implementation of XQuery on SQL Server 2005.
There are no XQuery UDFs or  modules/libraries,  no LET clause in flwor, there is no document() (or equivalent) function, the context functions can only be used in predicates, only some filter expressions are allowed in path expressions, if you are using the 'at' keyword you can't use a positional variable with the for clause of FLWOR, there are limitations in what you can use over constructed sequences, ordinal predicates to be numeric literal values (you can't dynamically construct the name of an element)
I could go on and on. The full list is in the http://technet.microsoft.com/en-us/library/ms345122.aspx in the section 'Non-Supported Features and Workarounds'
I agree that it is tough to implement it all, but then Microsoft had five years. Is it all working fine in SQL Server 2008? We'll soon know.
June 25, 2008 11:53 AM
 

paschott said:

Where to start? I think my favorite is the wonderful management tool change for assigning permissions.  I remember SQL 6.5 - it was easy to pull up a role and just grant a bunch of permissions and modify as needed through the GUI.  SQL 7.0 was a little worse.  SQL 2000 and 2005 are horrible to the point that you can't do it in any reasonable way using just the keyboard and the number of mouse-clicks required is insane.

I agree about the XQuery support - it does feel undone.

SSIS Import wizard - with just a little extra tweaking, it would be easy to include Paradox 5.x and DBase as extensions of the JET type, but it was left out.

Minor addition to the UNDO/REDO mention above - the turn on/off tracking to make changes just seems to take ages and about the same amount of time when making lots of changes. I never quite understood that.  Not sure if that's related to using SQL Prompt or not, but I know that whichever option I choose for larger files still results in a long wait time.
 Also, the Undo/Redo tracking limit was upped for 2005. I switched to that as soon as possible from 2000, but agree with the sentiment. What's up with small undo/redo buffers on modern machines?

Removal of Select top ... from and similar options to open a table/query. I didn't use it often, but it was convenient sometimes to just open a table and type in values.

The odd Modify/Edit options that used to pull up a SQL Script and now mean you may or may not pull up a graphical editor or a SQL Script. Which is which?

SSIS not handling errors in the import wizard more gracefully, especially for things like drop/create tables.  If table already exists and it tries to create a new table, the whole package fails.

 I think my favorite MS entries are scripts that they provide that depend on the older datatypes like Text and Image. We ran several scripts and the tables are still created as Text/Image rather than varchar/binary(max). Having even an option would be nice in order to support their newer database server.  We ran into this with some of their .Net Framework 3.0 and 3.5 scripts - isn't SQL 2000 about to be deprecated for support?  ;-)

Sadly, you mentioned my favorite tumbleweeds in the article. Text/Image types (ugh) and the templates. I never really got around to playing with SQLCMD and it sounds like that's a good thing now.
July 2, 2008 3:36 PM
You need to sign in to comment on this blog

















<June 2008>
SuMoTuWeThFrSa
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
On the Trail of the Expanding Databases
 It is sometimes difficult for other IT people to understand the constraints that DBAs have to work... Read more...

SQL Server 2008: The New Data Types
 Brad continues his helicopter-level view of the most interesting new features of SQL Server 2008 with a... Read more...

Reporting on Mobile Device Activity Using Exchange 2007 ActiveSync Logs
 In this new column giving practical advice on all things Sys Admin related, Ben Lye takes on the often... Read more...

The Bejeweled Puzzle in SQL
 Alex Kozak provides another SQL puzzle to hone your SQL Skills with.  Read more...

Using Powershell to Generate Table-Creation Scripts
 For all of us who learn best by trying out examples, Bob Sheldon produces a PowerShell script file for... Read more...