Show SQL-Server-Log in a view

JonnyD
Member Posts: 18
Hello everybody!
I have to implement a table in NAV 4.0 SP3 that shows the current SQL-Server-2005-Log. As far as I know it's possible to implement it as a Table with the property "Linked Objekt = yes" and give the table the same name of the SQL-View that "keeps" the data.
So this is a question for all you T-SQL-experts: Can anybody give me the T-SQL-source code of a view that shows me the content of the sql-server-log which can be shown in the "SQL Server Management Studio" under
SQL-Server --> Management --> SQL-Server Logs?
Unfortunately I'm absolutely not familiar with the syntax of T-SQL and all those things that are possible with T-SQL so I hope one of you can help me.
Thank you in advance!
Jonny
I have to implement a table in NAV 4.0 SP3 that shows the current SQL-Server-2005-Log. As far as I know it's possible to implement it as a Table with the property "Linked Objekt = yes" and give the table the same name of the SQL-View that "keeps" the data.
So this is a question for all you T-SQL-experts: Can anybody give me the T-SQL-source code of a view that shows me the content of the sql-server-log which can be shown in the "SQL Server Management Studio" under
SQL-Server --> Management --> SQL-Server Logs?
Unfortunately I'm absolutely not familiar with the syntax of T-SQL and all those things that are possible with T-SQL so I hope one of you can help me.
Thank you in advance!
Jonny
0
Comments
-
Hmmm ... I'm not if this could be done at all ... the "SQL Server Log" is actually a text-file, not a table, usually saved in ...\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\
So, IMO, why don't you directly import it into a real NAV table?Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
Hello you can use the following code to return the sql log
EXEC master.dbo.xp_readerrorlog
In order to run this from navision you have use ADO and connect to the sql server. run the comand which will return the record set. Store it in temporary table in navision and the display it on the form. Put your code on open form trigger so that it runs the sql statement and your form gets the latest info.0 -
I'm just interested, but why would you want to do this?0
-
We want to certify one of our products and one of the criteria is that every loggin that was not successful must be logged within the application. So it's necessary to somehow get all the stuff of the SQL server into NAV.0
-
I'm not sure there's anything which will read the logs in this way, I'll perhaps have a look - the T-SQL that reads the log reads all the log, there's no ability to be selective. I'd have thought such an audit log should be independent of the application - if you store the info in the application you technically run the risk of thr data being modified.
An interesting issue - you may need a third party tool to read the log, Baretail springs to mind, prior to putting into sql server.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions