Re: Perms on Tempdb?

From: Rick (b_at_bt.net)
Date: 01/27/04


Date: Tue, 27 Jan 2004 07:11:54 -0600

We understood all of that.

It doesn't explain why we're getting a permissions error.

Anyone?

"Kevin McDonnell [MSFT]" <kevmc@online.microsoft.com> wrote in message
news:L5mdhtG5DHA.1988@cpmsftngxa07.phx.gbl...
> Temporary tables are just that. Temporary.
>
> The user should have Public access to the database.
>
> From Books Online:
>
> tempdb is re-created every time SQL Server is started so the system starts
> with a clean copy of the database. Because temporary tables and stored
> procedures are dropped automatically on disconnect, and no connections are
> active when the system is shut down, there is never anything in tempdb to
> be saved from one session of SQL Server to another.
>
> Temporary tables are automatically dropped when they go out of scope,
> unless explicitly dropped using DROP TABLE:
>
> A local temporary table created in a stored procedure is dropped
> automatically when the stored procedure completes. The table can be
> referenced by any nested stored procedures executed by the stored
procedure
> that created the table. The table cannot be referenced by the process
which
> called the stored procedure that created the table.
>
>
> All other local temporary tables are dropped automatically at the end of
> the current session.
>
>
> 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.
>
>
>
> Thanks,
>
> Kevin McDonnell
> Microsoft Corporation
>
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
>



Relevant Pages

  • RE: Perms on Tempdb?
    ... be saved from one session of SQL Server to another. ... A local temporary table created in a stored procedure is dropped ... created the table ends and all other tasks have stopped referencing them. ...
    (microsoft.public.sqlserver.security)
  • Re: Perms on Tempdb?
    ... Is there a startup stored procedure that removes 'unwanted' ... Has your copy of the 'model' database been altered? ... >> be saved from one session of SQL Server to another. ... >> was actively referencing the table when the creating session ended. ...
    (microsoft.public.sqlserver.security)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)
  • Re: Performance problem on initial call of stored procedure
    ... The initial call to a stored procedure that performs 3 sql select ... If you let the session set for around 5 minutes, ... The websphere configuration is running on a Windows NT machine and, ...
    (comp.sys.ibm.as400.misc)
  • Re: Performance problem on initial call of stored procedure
    ... The initial call to a stored procedure that performs 3 sql select ... If you let the session set for around 5 minutes, ... The websphere configuration is running on a Windows NT machine and, ...
    (comp.sys.ibm.as400.misc)

Quantcast