Realtime record count for table...
here's little sql 2005 script i wrote:
1. start running script....
declare @x int
select @x = 1
while ( @x < 75000)
begin
insert into mytesttable values (@x)
select @x = @x + 1
end
2. while script still running, want know how many records in table. same query window script, i have run both of following statements.
select count(*) mytesttable
witn (nolock)
select count(*) mytesttable
witn (tablock)
instead of getting the answer immediately, run after original script has completed. seem "blocked". how can near realtime count of number of records in table while script populates table?
thanks,
barkingdog
barkingdog wrote: | |
|
the query window runs statements sequentially , not run next statement until prior 1 has finished, select count(*)... not run until statements in the while loop complete. it's not "blocking" connection, has not completed prior statements...
if one of replies solved problem, please mark them answered...
SQL Server > Getting started with SQL Server
Comments
Post a Comment