Modify TSQL script

Fullført Lagt ut 4 år siden Betales ved levering
Fullført Betales ved levering

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

SQL MySQL Microsoft SQL Server PHP Programvarearkitektur

Prosjekt-ID: #23880342

Om prosjektet

5 bud Eksternt prosjekt Aktiv 4 år siden

Tildelt til:

jeyhunilysov

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 Mer

$100 USD på 1 dag
(11 omtaler)
4.8

5 frilansere byr i gjennomsnitt $152 for denne jobben

schoudhary1553

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 Mer

$220 USD på 4 dager
(124 Omtaler)
7.2
aesthetichunzai

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

$100 USD på 3 dager
(13 Omtaler)
4.5
hantoyma

Hello, I have more of 10 years of experience working as a developer using Microsoft technologies, including sql server I have been providing SQL server support support to organization of all sizes, I have fixed and Mer

$200 USD på 7 dager
(2 Omtaler)
3.4
F2210655640

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 # Mer

$140 USD på 7 dager
(0 Omtaler)
0.0