jump to navigation

SQL SERVER : Semuanya Lewat Script (2) – Create Temporary Table July 15, 2006

Posted by sarach in SQL Server, Tips Programming, Visual Basic, Web Master.
trackback
Sql Server Ada kalanya, pada saat melakukan programming (vb misalnya) kita membutuhkan suatu table yang bersifat sementara atau temporary table, misalnya untuk menampung hasil dari suatu proses atau query.
Berikut ringkasan singkat tentang pembuatan table sementara yang saya bawakan dalam versi aslinya (..england = gerrad !!) 

Create a temporary table


Creating a temporary table is virtually the same as creating a normal table. The main exception is the naming of the table. A hash (‘#’) character as the first character in the table name denotes that it is a temporary table.There are two types of temporary tables, local and global.A local temporary table has a single hash (‘#‘) at the start of its name. A local temporary table is visible only to the user who created it and is destroyed automatically when that user disconnects.A global temporary table is denoted by a name starting with two hashes (i.e. ‘##‘). A global temporary table is visible to all users and is deleted automatically when the last user who has referenced the table disconnects.

An example of creating a local temporary table:

create table #foo
(
    CarIndex  smallint,
    CarType   varchar(20)
)

An example of creating a global temporary table:

create table ##baz
(
    CarIndex  smallint,
    CarType   varchar(20)
)

visit : https://pondokindah.wordpress.com/

Comments

1. Cun Cun - June 15, 2007

klo di ms access gimana caranya yaa..
thanks.

2. arimursandhi - February 20, 2008

kasi deklar nyang komplit atuh…..
nyong mlh jd binun….

btw suwun sanget..
dah rada2 nyaut


Sorry comments are closed for this entry

%d bloggers like this: