Hi,

Jawabnya:
1. temp table bisa diakses oleh sp lain (selama sp yg membuat temp table tsb
sessionnya masih connect),
2. dan bisa juga tidak bisa diakses oleh sp lain walaupun sessionnya
mengcreatenya masih connect (sifat tablenya private).

Untuk mengsimulasikan kedua hal ini kita perlu membuka session yang berbeda
(2 window)
Point 1:
*** Window 1 ***
select top 10 * into ##tmp2 from northwind..orders

(10 row(s) affected)
------------------------------------
select count(*) recs from ##tmp2
recs
-----------
10

(1 row(s) affected)
------------------------------------
*** Di Window 2 ***
select count(*) recs from ##tmp2
recs
-----------
10

(1 row(s) affected)
------------------------------------
:: Window 2 bisa melakukan query thp temp table yang dibuat di Window 1.


Point 2:
*** Window 1 ***
select top 10 * into #tmp1 from northwind..orders

(10 row(s) affected)
------------------------------------
select count(*) recs from #tmp1
recs
-----------
10

(1 row(s) affected)
------------------------------------
*** Di Window 2 ***
select count(*) recs from #tmp1
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name '#tmp1'.
------------------------------------
:: Window 2 gagal melakukan query thp temp table yang dibuat di Window 1.

Kesimpulan:
Yang membedakan diantara keduanya adalah tanda # di depan nama table, ## utk
bisa share, dan # utk private.


HTH,
Rudy Susanto

On 3/17/06, hs4n <[EMAIL PROTECTED]> wrote:
>
>  kalo bisa ada codenya :-)
>
> apakah temporary table itu hanya bisa diakses oleh sp yg
> mengcreatenya? atau sp lain yg masih dalam satu session connection?
>
> thx
>


[Non-text portions of this message have been removed]





BinusNet founded on Dec 28, 1998 Owner : Johan Setiawan
Moderator BinusNet : Suryadi Liawatimena & Surya Iskandar


Stop or Unsubscribe: send blank email to [EMAIL PROTECTED]
Questions or Suggestions, send e-mail to [EMAIL PROTECTED]

-=-=-=-=-=-=-=-=-=-=--==-=--==-=-=--=-=-=-=-=-=
Bina Nusantara mempersembahkan
25 Tahun Bersama Binus untuk Indonesia
1981 - 2006

Venue: Plenary Hall, Jakarta Convention Center
Date : 25 February 2006
-=-=-=-=-=-=-=-=-=-=--==-=--==-=-=--=-=-=-=-=-=
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/binusnet/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Kirim email ke