Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 #tbl and table variable

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-09-22 : 06:53:01
Dear All,

Instead of #table I am Using Table Variable..
Because 250 Users Access the same sp. I feel The #table May cause the locking
which one is better


Thanks and regards
Krishnakumar

pootle_flump

1064 Posts

Posted - 2006-09-22 : 07:31:55
quote:
Originally posted by CSK

which one is better

No such easy answer I'm afraid:
http://sqlnerd.blogspot.com/2005/09/temp-tables-vs-table-variables.html

HTH
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-22 : 07:32:22
Hard to tell. It depends what the temporary table is used for, how long and if rollback is needed.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-09-22 : 07:40:06
THE #TABLE HAS USED FOR JUST INSERTING THE EMPLOYEE CODE. THE TABLE CONTAINS 1000 ROWS
ONLY. BUT 250 USERS MAY ACESS IN SAME TIME..!!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-22 : 07:58:22
I would prefer #Tables if 250 simultaneous users.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-09-22 : 08:18:09
In terms of locking, they should be the same. the scope of both #Temp tables and table variables are just for the current batch, so concurrency will not be an issue. Performance may be another story.

- Jeff
Go to Top of Page
   

- Advertisement -