Hi,
I am reading records from a second (non-NAV database). The records go into a General Journal. After reading all the records, I want to delete the records from the source non-NAV table.
Rather than using the "standard" ADO method, I created a linked table in NAV. I can read the records just fine, but when I try to DELETE the records, I receive an error:
Microsoft Dynamics NAV
The following SQL Server error(s) occurred while accessing the USBIRD_ALLOC_TXN table:
7395,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to start a nested transaction for OLE DB provider "SQLNCLI" for linked server "XXXXXX". A nested transaction was required because the XACT_ABORT option was set to OFF.
7412,"01000",[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider "SQLNCLI" for linked server "XXXXXX" returned message "Cannot start more transactions on this session.".
SQL:
DELETE FROM "YYYYY"."dbo"."SOURCETABLE" WITH (REPEATABLEREAD) WHERE ("RecID"=N'1')
Googling this error message hasn't been much help. If you're executing Transact-SQL code, then you can theoretically set the proper switch, but I'm just doing a DELETEALL (also tried looping through each record and doing a DELETE).
Has anyone had success deleting records from a linked server table via C/AL Code not using ADO?
Thx
Ron
0
Comments
Please let us know if this is of any help.
Chn
That's exactly what I'm doing. I have a view defined in my NAV database that does a
CREATE View [dbo].[SOURCETABLE] AS
SELECT
EntryNumber
,DepartmentCode
,ProjectCode
,GLAccountNo
,Description
,TransAmt
,PostingDate
,UserID
FROM [XXXXXXXXX].[LinkedDatabaseName.[dbo].[GLImportTable]
I then defined a Linked Table SOURCETABLE in NAV (LinkedView=Yes).
Then, after reading the records (which works fine), I tried both a DELETEALL and looping through the table record by record and doing a DELETE. Received the above error.
Ron
thank bro .... it's work ....
Is it only me - or this stopped working in NAV2013 R2?...
"LinkedInTransaction" property still exists but looks like it is not handled by NAV anymore...
:?
While updating value in linked table (having LinkedInTransaction set to "NO") like this:
IN NAV2013 - both types are executed in the same way:
The only difference I can see is that for update of linked table @p1 parameter is initialised as NULL
I could be wrong - as I am no expert on this - but something is not right there...
Any comments? :-k
I haven't got the answer yet if they are going to re-implement this feature - but I got from Microsoft quite clever workaround - which combined with delay insert set on pages - makes linked data fully editable again.
They told me to create INSTEAD OF triggers for any view:
I had to dig a bit but in the end I ended with all three triggers (insert, update, modify) being overloaded - and it works. \:D/
Thanks!
-Doug