Form 5708 Locks in SQL

Hello everyone

We are working with Microsoft Business Solutions-Navision 3.70.B and Microsoft SQL Server Option

Sometimes when the user opens the form 5708 Get Receipt Lines, there is a blockage that prevents SQL continue working.

Analyzing the lock from SQL Query Analyzer shows that spid and blk are equal, ie: SQL is being blocked by spid own.

The code formualario in 5708 to perform a function using a temporary table.
Is there any way to rewrite this code so that there are no locks in SQL?

IsFirstDocLine()

TempSalesShptLine.RESET;
TempSalesShptLine.COPYFILTERS(Rec);
TempSalesShptLine.SETRANGE(“Document No.”,“Document No.”);
IF NOT TempSalesShptLine.FIND(’-’) THEN BEGIN
SalesShptLine.COPYFILTERS(Rec);
SalesShptLine.SETRANGE(“Document No.”,“Document No.”);
SalesShptLine.FIND(’-’);
TempSalesShptLine := SalesShptLine;
TempSalesShptLine.INSERT;
END;
IF “Line No.” = TempSalesShptLine.“Line No.” THEN
EXIT(TRUE);

Hello everyone

We still have the same symptoms, but it only happens sometimes

SQL Query Analyzer from the command sp_lock verify that there is a rate lock (Sch-S) on the table Sales Shipment Line

[http://msdn.microsoft.com/en-us/library/ms175519 (SQL.90). aspx ](http://msdn.microsoft.com/en-us/library/ms175519 (SQL.90). aspx )

The Database Engine uses schema stability (Sch-S) locks when compiling and executing queries. Sch-S locks do not block any transactional locks, including exclusive (X) locks. Therefore, other transactions, including those with X locks on a table, continue to run while a query is being compiled. However, concurrent DDL operations, and concurrent DML operations that acquire Sch-M locks, can not be performed on the table.

Someone can make something on this?