• twin.devil (8/21/2014)


    Just for the information.

    Becuase #table names max length is only 116 characters in SQL Server 2008 r2. its also valid of SQL SERVER 2012.

    It's valid in every version from SQL Server 2005 to SQL Server 2014 inclusive. Probably in SQL Server 2000 too, but I haven't kept a copy of the transact-sql reference for SQL Server 2000 so I'm only 99.5% certain of that.

    I don't imagine it will change any time soon. It allows more than 5*10**413 local temp table names in each connection, which should be more than enough for anyone, and anyway that number of identifiers would require rather a lot of storage just to hold their names in tempdb - a single connection using that many local temp tables many would use over 5.8*10**415 bytes of storage in tempdb just to hold the names, and that is quite a lot more disc (including drum and solid state) store than has yet been manufactured on our planet, in fact manufacturing it would require the use of more than 10**300 times as much matter as is believed to exist in our universe, let alone on our planet.

    Tom