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)
 same issue for concurrent executions

Author  Topic 

dasu
Posting Yak Master

104 Posts

Posted - 2004-08-17 : 05:34:33
Really the solution is excellent but i am unable to use that
in my application the solution which u sent is this
"
alter proc das_ee @tn varchar(40)
as
declare
@cnt varchar(30),
@q varchar(400)
create table #cnt(cnt int)
set @q='insert into #cnt select count(*) from '+ @tn
exec (@q)
set @cnt = (select cnt from #cnt)
drop table #cnt

print (@cnt)
"
Here its work greatly for single system aplications
asume my application has concurrent executions then
acording to above solution we will get two tables(two tranxactions cocurrently).that time there may be conflict.
please suggest me for concurrent case

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-08-17 : 05:45:39
This should not be a problem a #temp table is only available to its own session whereas a ##temp table is available to all sessions running while the session that created the ##temp table is available.

Therefore you can create a #temp table in one session now. and in another session create exactly the same #temp table and there will be no conflict.

I hope this makes sense.


Duane.
Go to Top of Page
   

- Advertisement -