This question is locked. New answers and comments are not allowed.
Hi,
My company is looking for a solution to allow us to move away from using stored procedures and to substitute them with functionality we can employ from the code. OpenAccess looks like the right tool for this job.
We would look at using LINQ to convert the existing stored procedures but even going through the OpenAccess documentation it still seems pretty difficult how we would elegantly rewrite some of these stored procedures without doing multiple selects.
If we could maybe just have a pointer in the right direction by means of a simple example that'll be a great help.
My questions would be:
For example this procedure:
Thank you for your help with getting us going on this road!
My company is looking for a solution to allow us to move away from using stored procedures and to substitute them with functionality we can employ from the code. OpenAccess looks like the right tool for this job.
We would look at using LINQ to convert the existing stored procedures but even going through the OpenAccess documentation it still seems pretty difficult how we would elegantly rewrite some of these stored procedures without doing multiple selects.
If we could maybe just have a pointer in the right direction by means of a simple example that'll be a great help.
My questions would be:
- How many times would the following procedure need to execute against the database with select statements?
- Is there any performance issues calling multiple selects via LINQ to construct this statement when compared to the sql stored procedure?
- Is there a way to update a value in a table without having to load the record first?
For example this procedure:
IF((
SELECT
COUNT
(1)
FROM
_POSPaymentsDetail
WHERE
Branch = @Branch
AND
UniqueId = @UniqueId
AND
PostingStatus =
'COMPLETE'
AND
PostingError =
''
) = (
SELECT
COUNT
(1)
FROM
_POSPaymentsDetail
WHERE
Branch = @Branch
AND
UniqueId = @UniqueId))
BEGIN
UPDATE
_POSTransactionHeader
SET
PostingStatus =
'COMPLETE'
WHERE
Branch = @Branch
AND
UniqueId = @UniqueId
END
Thank you for your help with getting us going on this road!