Modify TSQL script
$30-250 USD
Paid on delivery
I setup SQL audit and dumping data into this location: O:\Audit\Data1. Now I need to load data into SQL table, AuditInfo. I need to run the following query in SQL job everyday.
The following script works fine. Modification needed, so when it runs every day, it will load only the previous day data into SQL table.
SELECT distinct *
FROM sys.fn_get_audit_file('O:\Audit\Data1\*.*', DEFAULT, DEFAULT)
INSERT INTO Test.[dbo].[AuditInfo] (
event_time
,action_id
,server_principal_name
,server_instance_name
,database_name
,schema_name
,object_name
,statement
)
SELECT event_time
,action_id
,server_principal_name
,server_instance_name
,database_name
,schema_name
,object_name
,statement
FROM sys.fn_get_audit_file('O:\Audit\Data1\*.*', DEFAULT, DEFAULT)
I need to modify this query, so the records that were inserted yesterday will be loaded into the SQL table
For example:
If I run the job 02/03/2020 at 9 pm the records on 02/02/2020 will be loaded
02/04/2020 at 9 pm the records on 02/03/2020 will be loaded
02/05/2020 at 9 pm the records on 02/04/2020 will be loaded
Project ID: #23880342
About the project
Awarded to:
Hi, there. I see that you need some help modifying SQL for your project. I can help with that and can start right away. I am senior web developer and have 5+ years of experience with Mysql. I am sure that I can do your More
5 freelancers are bidding on average $152 for this job
Hello, I can help you with your project - Modify TSQL script I have gone through your job posting and become very much interested to work with you. I am an expert in this field. I have already completed several proj More
Hi I can provide you with solution based on your requirements i am experienced Database Admin with 13 years of exp with oracle and SQL Server
I have been engaged in software development for many years. I have extensive software development experience and can complete various software development tasks. My main skills are as follows Back-end technologies: C # More