#temp table changes

In versions earlier than 15.0, the 30-character limit for #temp table names meant that user temporary tables in tempdb were named with the hash symbol (#), 12 distinct characters, plus a 170-byte hash. Names shorter than 12 characters were padded with underscores to achieve a length of 12 characters.

This example creates a temporary table named #temp_t1______0000021008240896:

select *
into #temp_t1
from mytable
where …

Adaptive Server 15.0 names for temporary tables:

This change should not affect applications, except applications built in Adaptive Server 15.0 may not be backwardly compatible to Adaptive Server 12.5.

The following examples describes successful and failed scenarios for creating temporary tables in Adaptive Server versions 12.5 and 15.0.

This example fails in Adaptive Server 12.5, but succeeds in Adaptive Server 15.0 because in 12.5, the automatic padding with underscore results in tables with the same name:

create table #mytemp (…)
create table #mytemp___ (…)

This example fails in Adaptive Server 12.5 because the temporary table names are truncated to 12 characters. It succeeds in Adaptive Server 15.0 because this version does not truncate table names:

create table #t12345678901 (…)
create table #t1234567890123 (…)

This example refers to the same table in Adaptive Server 12.5, but to different tables in Adaptive Server 15.0 for the same reason (name truncation) described in the example above:

select * from #t12345678901
select * from #t1234567890123456