Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning Recordset For Cursor
Message
 
 
To
05/01/2001 11:14:56
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00459813
Message ID:
00459855
Views:
23
>Thanks. But, if a create a global temporary table could that collide with other users running the procs and creating that same table at the same time?

Yes it probably would. But global temp tables are the only way I know of passing information from one procedure to another. If they aren't global, then any temp table created in one proc goes away atthe end of the proc.

You could try creating a unique table name for each user using the newid() function. Then pass the tablename variable around and use sp_executesql to execute SQL statements creating using the variable. Ex.
declare @tablename char(36), @cmd nvarchar(300)
set @tablename = '##'+replace(convert(char(36),newid()),'-','')
set @cmd = N'create table ' + @tablename + ' (field1 int)'
exec sp_executesql @cmd
You can explicitly drop it at the end of your processing or let SQL Server do it when you disconnect.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform