I am doing some scripting against a sql server database. In the course
of the scripting I update a text field of one of my tables and soon
after that run a select against that same table looking at the text
field.
For example,
update books set chapter1 = "some text about trees ..." where id = 99
.
<a few lines of work>
.
select id from books where chapter1 like '%trees%'
Is it possible that the second query is run before the update of
chapter1 from the first query is completed?
Tibor Karaszi - 04 Mar 2008 19:14 GMT
> Is it possible that the second query is run before the update of
> chapter1 from the first query is completed?
No. SQL statements are executed synchronously, seen from the client application's perspective.

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
>I am doing some scripting against a sql server database. In the course
> of the scripting I update a text field of one of my tables and soon
[quoted text clipped - 11 lines]
> Is it possible that the second query is run before the update of
> chapter1 from the first query is completed?
Brynn - 05 Mar 2008 01:46 GMT
> I am doing some scripting against a sql server database. In the course
> of the scripting I update a text field of one of my tables and soon
[quoted text clipped - 11 lines]
> Is it possible that the second query is run before the update of
> chapter1 from the first query is completed?
What are you experiencing?
aw - 06 Mar 2008 15:30 GMT
I have a classic asp page where I run the first update query and then
a few javascript lines later I run the select query. I am sometime not
getting that updated row in the result set for the select query.
> > I am doing some scripting against a sql server database. In the course
> > of the scripting I update atext fieldof one of my tables and soon
[quoted text clipped - 12 lines]
>
> What are you experiencing?