May 13, 2014 at 7:29 am
I have a set of query which is being used for generating Audit reports which is not being supported in MSSQL.
SELECT distinct DATE_FORMAT(arc_endTime,"%Y-%m-%e-%H:%i:%s") "Event Time",
arc_destinationHostName "Host Name",
arc_destinationUserName "User Name",
arc_sourceHostName "From Host",
arc_sourceAddress "From IP Address",
arc_deviceCustomString2 "Database",
arc_deviceCustomString1 "Object Name",
arc_name "Procedure",
arc_message "Action",
arc_deviceEventClassId "Event ID",
DATE_FORMAT(arc_eventTime,"%Y-%m-%e-%H:%i:%s") "Logger Time",
arc_deviceProduct "Device Product"
FROM events
WHERE arc_deviceProduct = 'SQL Server'
AND arc_deviceCustomString2 = 'HR_Time'
AND arc_deviceHostName = ‘enter device name here’
If someone could help me to get this executed in SQL 2005 would be more helpful.
May 13, 2014 at 7:46 am
This should be pretty close
😎
SELECT distinct CONVERT(DATETIME,arc_endTime,120) AS [Event Time],
arc_destinationHostName AS [Host Name],
arc_destinationUserName AS [User Name],
arc_sourceHostName AS [From Host],
arc_sourceAddress AS [From IP Address],
arc_deviceCustomString2 AS [Database],
arc_deviceCustomString1 AS [Object Name],
arc_name AS [Procedure],
arc_message AS [Action],
arc_deviceEventClassId AS [Event ID],
CONVERT(DATETIME,arc_eventTime,120) AS [Logger Time],
arc_deviceProduct AS [Device Product]
FROM events
WHERE arc_deviceProduct = 'SQL Server'
AND arc_deviceCustomString2 = 'HR_Time'
AND arc_deviceHostName = 'enter device name here'
May 13, 2014 at 8:32 am
Thanks for your quick reply...I am getting the error message as:
Invalid object name 'events'.
May 13, 2014 at 9:08 am
That means that your database doesn't have a table (or view) called events. Check that you're running the query in the correct db and that the table exists.
May 13, 2014 at 9:18 am
If the table exist, it could be in another schema. Change the code to (schema_name).[events] if you find it.
😎
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply