I'm Not Sure I Want To Know...



  • ... what's going on in my coworker's stored procedure:

    CREATE TABLE failed because column 'c1017' in table '#output' exceeds the maximum of 1024 columns.



  • Dynamic SQL gone horribly awry?



  • @Edgesmash said:

    ... what's going on in my coworker's stored procedure:

    CREATE TABLE failed because column 'c1017' in table '#output' exceeds the maximum of 1024 columns.

    Sounds like a classic Horizontal Table Architecture (HTA) .  HTA uses breadth of relational database columns instead of the number of columns (or a joined table) as a means to store large quantities of data.  This is a popular apporach with people who think of a database as a spreadsheet.




  • That's scary! I've been working with MSSQL for over 9 years now and I've never seen ANYTHING like that. Has anyone grabbed this guy by the neck and slapped him silly yet? This is not just a WTF, its an OMGWTF ^100



  • @joe_bruin said:

    @Edgesmash said:

    ... what's going on in my coworker's stored procedure:

    CREATE TABLE failed because column 'c1017' in table '#output' exceeds the maximum of 1024 columns.

    Sounds like a classic Horizontal Table Architecture (HTA) .  HTA uses breadth of relational database columns instead of the number of columns (or a joined table) as a means to store large quantities of data.  This is a popular apporach with people who think of a database as a spreadsheet.


     
    Another common example is when people store application settings in the database. The table generally has one and only one row, with a column for each setting.  We used to have that in an old OMNIS datafile application - when attempting to convert the application to sybase (which had a 250-odd column limit), it would barf. Needless to say at that point I decided to refactor the settings table into a saner key-value pair type of approach...

     



  • Another common cause for this kind of idiocy is Access. There's nothing quite like a GUI designer to get ignorant people with no clue or comprehension whatsoever to construct insane databases.



  • The real WTF is that column 1024 is numbered 1017.  Now how the hell did that happen?



  • @KattMan said:

    The real WTF is that column 1024 is numbered 1017.  Now how the hell did that happen?

    How much you want to bet that he had to shimmy in crap like 'c0617.5' somewhere along the way? Shudder...



  • No...

    The first 7 Columns tell you what data is present in the other columns. So they are called T0 - T3 (Including T2.25, T2.5 and T2.75 of  course)



  • @nerdydeeds said:

    Dynamic SQL gone horribly awry?


    I did some digging and that's what it is. I already yelled at the developer who wrote it.



  • @Edgesmash said:

    I did some digging and that's what it is. I already yelled at the developer who wrote it.

    It's quite often when things like this happen that we wish we could yell and gesticulate at the people responsible directly.

    I am happy that you can do this in our stead. 


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.