Showing posts with label temporary. Show all posts
Showing posts with label temporary. Show all posts

Sunday, March 25, 2012

create systemtables?

Is there any way to create a systemtable?
I need to hide a table of my own from regular users. This table is not
temporary.
Kind regards,
Costi StanFor SQL Server 2000, It won't necessarily keep users from
being able to find out the table exists. You could use an
undocumented, unsupported method using the system stored
procedure sp_MS_marksystemobject. Not sure why you would as
you could also just create a table with a name that has no
meaning to the users and prevent access using built in
security methods. But something like:
CREATE TABLE UserSystem
(SomeID int primary key not null,
SomeCol varchar(25))
GO
EXEC sp_MS_marksystemobject 'UserSystem'
GO
-Sue
On Tue, 29 Aug 2006 17:24:28 +0300, "Costi Stan"
<stancosti@.yahoo.com> wrote:
>Is there any way to create a systemtable?
>I need to hide a table of my own from regular users. This table is not
>temporary.
>Kind regards,
>Costi Stan
>

Friday, February 24, 2012

create global temporary tables in SQL SERVER

I m trying to create a global temporary table whose data will be deleted after the end of the session..

the DDL in oracle is

CREATE GLOBAL TEMPORARY TABLE STUDENT
(

name CHAR(20),

) ON COMMIT DELETE ROWS ;

I want to know the corresponding DDL in SQL Server..

when i try the following

CREATE TABLE ##STUDENT
(

name CHAR(20),

)

the table gets deleted at the end of the session..help needed

when there is no more connection referencing the

GTT it automatically destroys itself

|||

There is not such a thing. You can create a permanent table and include in it's key the process_id value (which you can get from @.@.spid). Then you just delete the data from the table when you get finished (and when you start in case you don't get things cleaned up because of some error)

On the other hand, is it so bad for what you are doing to just create the structure on each run? And note that ##tables are available to all other connections, #tables just to your session. You should use # tables unless there is some compelling reason to use global temp tables.