Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A clean way to do this - join cursor with SQL
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00543385
Message ID:
00556531
Views:
20
Hi Andrew,

I'm sorry for the delay in the reply. I have been away long. Apologies. You are correct.

Regards,


>Hi Sanjay,
>
>My understanding is that the global temp table will be automatically dropped "when the session that created the table ends and all other tasks have stopped referencing them. The association between a task and a table is maintained only for the life of a single Transact-SQL statement. This means that a global temporary table is dropped at the completion of the last Transact-SQL statement that was actively referencing the table when the creating session ended."
>
>Is that not the case?
>
>Cheers,
>
>Andrew
>
>>Hi Mark,
>>
>>Just expanding on what Andrew has already mentioned, a single # would be enough to create a temporary table in SQL Server which would be available only to the connection that created it. The nice thing about it is that when the connection is closed, the temporary table is cleared by SQL Server. With a global temp table (using ##) the advantage is that it will be available to any connection, but you clear up yourself by dropping the table afterwards. It'll stay there until SQL server is re-started.
>>
>>Cheers,
>>
>>
>>>Hi Mark,
>>>
>>>You need a ## to create a global temporary table. From Books On Line (the Create Table topic):
>>>Global temporary tables are automatically dropped when the session that created the table ends and all other tasks have stopped referencing them. The association between a task and a table is maintained only for the life of a single Transact-SQL statement. This means that a global temporary table is dropped at the completion of the last Transact-SQL statement that was actively referencing the table when the creating session ended.
>>>
>>>Cheers,
>>>
>>>Andrew
>>>
Sanjay Kapoor

Relatively speaking is a conversation with Einstein
Previous
Reply
Map
View

Click here to load this message in the networking platform