• Luis Cazares (5/2/2016)


    Sioban Krzywicki (4/29/2016)


    Eric M Russell (4/29/2016)


    If you really want, you can also model an entire database containing objects with only spaces for names.

    create database [ ];

    GO

    use [ ];

    GO

    create schema [ ];

    GO

    create table [ ].[ ]

    (

    [ ] int

    );

    GO

    create proc [ ] as

    select * from [ ].[ ];

    GO

    :crazy:

    Nice! I'll have to try this sometime.

    You forgot to define a type.

    create database [ ];

    GO

    use [ ];

    GO

    CREATE TYPE [ ] FROM varchar(MAX);

    GO

    create schema [ ];

    GO

    create table [ ].[ ]

    (

    [ ] [ ]

    );

    GO

    create proc [ ] as

    select * from [ ].[ ];

    GO

    EXEC [ ];

    EXEC sp_help '[ ].[ ]';

    GO

    USE master;

    DROP DATABASE [ ];

    I used to do things like this wat back in "olden days". 🙂

    But I preferred using TAB instead of SPACE.

    And you know what?

    Enterprise Manager and Query Analyzer (for those who can't remember - SQL Server 2000 tools) both were working correctly with such tables, allowing me to add, edit, delete records with no issues.

    Which allowed me to play jokes on ".Net developers with SQL experience".

    Thier pathetic Visual Studio simply not do anything with such objects.

    As soon as SQL 2005 was out the fun was over.

    SSMS, just like VS, could not work correctly with tables having this kind of characters in their names.

    Out of curiosity I've just created a table named [TAB] (single character).

    This time I was using SQL 2012 SSMS.

    On attempt to add a row I've got an error message:

    No row was updated

    The data in row NN was not committed.

    Error Source: Microsoft.SqlServer.Management.Tools

    Error Message: Specified argument was out of the range of valid values.

    Parameter name: identifier.

    Funny that the row was actually committed.

    The error message is an error by itself.

    SQL Server engine was able to process the request correctly (this part was not "improved" by MS), but newer MS tools simply could not follow.

    _____________
    Code for TallyGenerator