web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

DB user got deleted

(0) ShareShare
ReportReport
Posted on by 90

Hi friends

 I have come across a weird issue in NAV classic SP1 environment.

Two DB users have got deleted from the system, I am not able to identify, when it was done, who has done it etc.

Is there any way to identify the changes that happened to the user records?

Thanks

Karthick

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi karthick

    I think, there is no way to achieve this one.  You just contact you system admin if everybody don't have super permission.

  • Karthick23 Profile Picture
    90 on at

    Hi Sandeep

    Thanks for the input, it is not possible to find out in NAV, but is there any other workaround or any other method in SQL to find the log?

    Thanks

    Karthick

  • Suggested answer
    Tobias Strobelt Profile Picture
    152 on at

    Hi Karthick,

    If the transaction log of your SQL-NAV-Database still exists you can run the following statement to see the "delete" tracking of your User table. Unfortunately you cannot see directly which data has been deleted as this is stored in binary form within the Transaction Log. If you need this Information in addition you can ask your SQL Server Admin to analyze the Row Content in detail for further Information which content has been deleted.

     

    SELECT deletes.AllocUnitName,deletes.Operation,l.[Begin Time],u.name
       FROM fn_dblog(NULL, NULL) l
    INNER JOIN ( SELECT [Transaction ID],AllocUnitName,[RowLog Contents 0],Operation
                              FROM fn_dblog(NULL, NULL) deletes2
                           WHERE (AllocUnitName = 'dbo.User.User$0'                 -- Database Login 
                                   OR AllocUnitName like 'dbo.$ndo$usrproperty%')   -- Windows Login
                                 AND Operation = 'LOP_DELETE_ROWS') deletes ON deletes.[Transaction ID] = l.[Transaction ID]
    INNER JOIN Master..sysusers u ON Convert(varchar(64),u.[sid],1) = Convert(varchar(64),[Transaction SID],1)
    WHERE l.Operation = 'LOP_BEGIN_XACT';

     

    But for your purpose it should fit to see when the user table has been touched for deletion and which user run the statement. For analyzing the binary content here´s an additional link:

    rusanu.com/.../how-to-read-and-interpret-the-sql-server-log

     

    In addition you can use the really helpfull stored procedure described in the following link.
    (credits to Muhammad Imran)

    http://raresql.com/2011/10/22/how-to-recover-deleted-data-from-sql-sever/

    Best regards,

    Tobias

  • Verified answer
    Karthick23 Profile Picture
    90 on at

    Thank you so much for all the inputs and time spent on this. I had no choice except creating the same user again and moved on.

    Tobias - thanks for the detailed input, but unfortunately i am not able to retrieve any value. Will keep this in handy .

    thanks once again

  • Tobias Strobelt Profile Picture
    152 on at

    I´ve added a hyperlink to the original post to link to a stored procedure where you can get the value back :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans