Using temporary tables  Manipulating temporary tables in stored procedures

Chapter 8: Creating Databases and Tables

Ensuring that the temporary table name is unique

To ensure that a temporary table name is unique for the current session, Adaptive Server:

The following example shows a table created as #temptable and stored as #temptable00000050010721973:

use pubs2 
go 
create table #temptable (task char(30)) 
go 
use tempdb 
go 
select name from sysobjects where name like
    "#temptable%" 
go 
name 
------------------------------ 
#temptable00000050010721973 
 
(1 row affected) 




Copyright © 2005. Sybase Inc. All rights reserved. Manipulating temporary tables in stored procedures

View this book as PDF