Home > Archive > MS SQL Server > February 2006 > SELECT right after INSERT returns empty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SELECT right after INSERT returns empty
vichai.levy@gmail.com

2006-02-06, 7:23 am

I'm writing a simple application that stores/pulls data into/from SQL
2005 Express Edition database.

In one process data is inserted to the database, on another process
same data gets pulled out. Both operations complete successfully and
fast however the puller sees the inserted data way after data insertion
has completed (1 - 3 minutes afterwards). I'm talking about no more
then a 100 records inserted while a select with a group by pulling this
data out and the table include less then 100K rows.

How can I improve these actions so that data inserted to the database
by the first process will immediately be seen by the puller process?
I appreciate your help.

Rick Sawtell

2006-02-06, 1:23 pm


<vichai.levy@gmail.com> wrote in message
news:1139226979.456381.22750@z14g2000cwz.googlegroups.com...
> I'm writing a simple application that stores/pulls data into/from SQL
> 2005 Express Edition database.
>
> In one process data is inserted to the database, on another process
> same data gets pulled out. Both operations complete successfully and
> fast however the puller sees the inserted data way after data insertion
> has completed (1 - 3 minutes afterwards). I'm talking about no more
> then a 100 records inserted while a select with a group by pulling this
> data out and the table include less then 100K rows.
>
> How can I improve these actions so that data inserted to the database
> by the first process will immediately be seen by the puller process?
> I appreciate your help.
>


Take a look at how your transactions are running.

Another possible option (if you don't mind reading data that may be
changing) is to have the second process ignore locking. Take a look at the
(NOLOCK) query hint.


Rick Sawtell
MCT, MCSD, MCDBA


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com