Go Back > Forum > Baan Quick Support: Functional & Technical > Tools Administration & Installation

User login

Frontpage Sponsor


How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
200 - 500 GB
500 - 800 GB
800 - 1200 GB
1200 - 1500 GB
1500 - 2000 GB
> 2000 GB
Total votes: 66

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 16th September 2014, 15:06
zymmon's Avatar
zymmon zymmon is offline
Junior Member
Join Date: Sep 2008
Posts: 6
zymmon is on a distinguished road
Baan: LN - DB: SQl Server - OS: Windows 2003
Hint "with(nolock)" on selects
Baan: ERP LN 6.1 FP2
DB: SQL Server 2005
OS: Windows 2003
C/S: Both

This post is related to a doubt I have regarding the use of the hint "with no lock" in my program scripts.

First of all, I want to clarify that the environment that I'm using uses MS SQL Server for the Database, where the "with nolock" hint becomes almost mandatory for the way the database manages the locking scheme.

Basically my doubt applies to the use of this hint on a query that includes more than one table. I'm not sure if the hint works at all or not, and if it works if it applies to all the tables in the join or just for the main table.

When I write that clause is ANSI SQL I use the hint in each table, but in LN I use the hint "with (nolock)" right before the Selectdo.

The example for this doubt should be the following:

select table1.field1
from table1,
where table1._index1 = {:variable}
and table2._index1 = table1.otherfield
hint "with(nolock)"
selectdo statements

Mi feeling (for what I have been able to try) is that the hint is not applying to all the tables in this case. On the other hand, when I use the hint for just one table it works perfectly.

That is why I'm posting this to know if someone can give me some feedback on your own experiences, and to know if you have ever found this problem and how to solve it.



Reply With Quote
Old 16th September 2014, 15:48
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Join Date: Sep 2012
Location: India
Posts: 2,371
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix

I guess in this Thread, Vahdani already advised a way to do updates in Baan. Did you tried the method he has shown?

I have worked on SQL Server Query Optimizer's and what I feel is for complex queries i.e. having more than 1 table in its selection the optimizer's do not behave in a right way and get confused on applying the hints. Hints are basically for building paths and optimizing query, so in your case it might be applying the hint to your first open object/table and for the next table it is applying something else.

What you can try is, split your query into two parts:-
select table1.field1
from table1
where table1._index1 = {:variable}
and table2._index1 = table1.otherfield
hint "with(nolock)"
    select table2.*
    from   table2
    where table2._index1 = :table1.otherfield
    hint "with(nolock)"

I am not sure about the table's and the data, but you can try using refers to clause in your query as well.

You can also try using "on" keyword.


select a.cuno, b.cuno
from   tppdm740 a, tccom010 b
where  a.cuno refers to b
and    a._compnr = 812
hint   use index 1 on b
hint   use index 2 on a

Not sure if it works on not.


Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hint nolocks en select zymmon Forum español 2 15th September 2014 18:11
Indian Subsidiary of China Based Meita Group Selects Merino Services to Implement Inf pritivandana Pages and Stories 0 17th January 2011 07:55
Help regarding tools session rahul.kolhe22 Tools Development 4 22nd January 2010 13:31
Amount of selects in tdinv6230m000 makiju Tools Administration & Installation 3 20th June 2002 11:23
How to prevent passing of hints generated by Oracle Driver ? baaniac Performance & Tuning 6 24th May 2002 11:16

All times are GMT +2. The time now is 11:23.

©2001-2018 - -