Re: temporäre Tabellen

From: Olaf Pietsch (olaf_pietsch_at_online.ms)
Date: 05/09/04


Date: Sun, 9 May 2004 15:10:58 +0200

Hallo Uwe,

In ukoR0qbNEHA.3420@TK2MSFTNGP11.phx.gbl, Uwe Kühne typed:
> Es erscheint mir logisch, dass es kein Problem gibt, wenn ein User
> mehrere Sessions offen hat, aber wie ist es, wenn mehrere User
> verschiedene Sessions offen haben? User A erstellt über das Programm
> die temporäre Tabelle #Empfaenger, User B ebenso. Wie handhabt
> SQL-Server hier die Unterscheidung???

User A und User B haben doch dabei auch unterschiedliche Sessions (oder ?),
die #temp. Tabellen werden vom SQL-Server je Session verwaltet. Es gilt auch
hierbei der Session Bezug, d. h. die A Session sieht nichts von der B
Session.
Wenn ein User C zwei Sessions C1 und C2 geöffnet hat, dass weiß die Session
C1 nichts von Session C2 oder von der A oder B Session.

Vergiß in diesem Zusammenhang den Bezug auf einen User, es ist immer ein
Session Bezug.

Anmerkung am Rande: Ich würde gerne vorschlagen, SP für Abfragen zu
verwenden, die temp. Tabellen verwenden. Die SP haben dabei den Vorteil, das
die #Temp. Tabellen, die in der SP erstellt werden, automatisch beseitigt
werden, wenn die SP beendet wird. (Ansonsten werden die #temp Tables erst
dann bereinigt, wenn die Session endet oder die Tables explizit gelöscht
werden.) Dabei können die @temp Tables auch einige Vorteile gegenüber den
#temp Tables in einer SP haben, da der SQL-Server diese nicht in der tempdb
verwaltet, sondern wie Variablen behandelt. Allerdings würde ich nicht GB's
von Daten in die @temp Tables speichern wollen.

Gruß Olaf



Relevant Pages

  • Re: linking a research form with a display page
    ... But if the webmaster will delete the record n°4, ... do I need to delete the temp table) or an other solution to do things ... and when the session is closed the temp table dies. ... this king of search->browse in display ...
    (comp.lang.php)
  • RE: [Info-ingres] ABF - temp tables and exec sql connect question s...
    ... The temp table is not destroyed, just that it's 'scope' is limited to the db ... If you want to 'merge' data from 2 db sessions into one session table you ... as I connect to db2 - how can I get round this and retreive data from ... Neither Npower nor any of the other companies in the RWE Npower group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments for viruses. ...
    (comp.databases.ingres)
  • Re: linking a research form with a display page
    ... I have a page rech.php where I'm doing a multi-criteria research Ex. ... do I need to delete the temp table) or an other solution to do things ... Depending on your database, you can create a persistent session, ...
    (comp.lang.php)
  • Re: Sessions using TEMP and sharing extents
    ... temp the single sort segment per node is shared but extents allocated ... within the segment are used by one session at a time. ... traditional dictionary management each session allocates its own ... Does this mean that with a locally managed Temp tablespace there is ...
    (comp.databases.oracle.server)