February 16, 2013 at 11:41 am
1 only one specific user query return timeout(may be due to thousand of records) but out of 300 users this query return time out only one specific user why?
Update Table1 set viewflag=1 where nid in(select nid from table2 where bid=31) and userid=350
my question is what is the best practices subquery is faster or
achieve the same result through loop one by one instead of subquery
2 select * from test123(ReadPast)
is it good practice to use ReadPast?
or use nolock?
3 for j=0 to dt.rows.count-1
userid=dt.rows(j).item("UserID")
obj.getMethod1( userid )
in this method we use this query in loop
Update Table1 set viewflag=1 where nid in(select nid from table2 where bid=31) and userid=350
next
is it good practice
or we use
for j=0 to dt.rows.count-1
userid=dt.rows(j).item("UserID")
userid=userid & ","
next
obj.getMethod1( userid )
in this method we use this query
Update Table1 set viewflag=1 where nid in(select nid from table2 where bid=31) and userid in (userid,..,,)
any body suggest which one is efficient approach and faster
or
alternative solution
February 16, 2013 at 1:50 pm
If you run the following, how many rows do you get?
select nid from table2 where bid=31
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply