Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query Gives Different Results Each Time Run - SQL Server 2000

Status
Not open for further replies.

bbbasket

Programmer
Joined
Jul 23, 2001
Messages
2
Location
US
SQL Server 2000 - When running the following update query I get a different set of results each time the stored procedure is run. I ran the stored procedure using a job 4 times, got 4 different results.
If I run the update query directly in Query Analyzer, my results are always the same.
The query:
Code:
    update COrdHz
	set Racf = a.N_server_id
	from nbtord a
	where a.ord_nbr = COrdHz.order_num
		and a.ord_supp = (select max(ord_supp) from nbtord b 
	where b.ord_nbr = a.ord_nbr and rtrim(ltrim(n_server_id)) is not null)
		and ltrim(rtrim(N_server_id)) is not null

Has anyone experienced this inconsistency?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top