Find Jobs
Hire Freelancers

create triggers for audit trail in sql server

$30-250 USD

In Progress
Posted almost 4 years ago

$30-250 USD

Paid on delivery
I have a few tables in my sql server 14.0 database that I want to monitor. I want to add triggers after insert, update and delete to these few tables. I want a log of every record inserted, updated, or deleted. One of the tables I would like to monitor is tblChild. Its definition is below. CREATE TABLE [dbo].[tblChild]( [ChildId] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [User] [numeric](18, 0) NULL, [FirstName] [nvarchar](50) NULL, [LastName] [nvarchar](50) NULL, [GradeLevel] [nvarchar](50) NULL, [DOB] [date] NULL, [PreviousExperiance] [nvarchar](max) NULL, [DateAdded] [datetime] NULL, [AutoReenroll] [bit] NULL, [Needs] [nvarchar](50) NULL, [NotesForRoster] [nvarchar](max) NULL, CONSTRAINT [PK_tblChild] PRIMARY KEY CLUSTERED ( [ChildId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO ALTER TABLE [dbo].[tblChild] ADD CONSTRAINT [DF_tblChild_DateAdded] DEFAULT (getdate()) FOR [DateAdded] GO The log should be written to my audit table. You can come up with the structure of the audit table. Specifically: If a record is inserted into tblChild, all of the fields’ values should be recorded in the log (audit table). If a record is deleted from tblChild, all of the fields’ values should be recorded in the log (audit table). If a record is updated in tblChild, all of the changed values should be recorded in the log (audit table), both old values and new values. The trigger should be smart, and loop through the fields using an approach similar to: SELECT @field = MIN( COLUMNPROPERTY( OBJECT_ID(TABLE_SCHEMA + '.' + @TableName), COLUMN_NAME, 'ColumnID' ) ) FROM [login to view URL] So I don’t have to change the trigger code if I add or rename a column. Also, the trigger should be smart and not allow an sql injection problems.
Project ID: 25594001

About the project

5 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
5 freelancers are bidding on average $164 USD for this job
User Avatar
Hello, As an expert in MSSQL, i am very much interested to create the required triggers in your tables. Looking forward to have a positive response from you. Thanks
$240 USD in 3 days
5.0 (183 reviews)
8.0
8.0
User Avatar
Hello! I am a Data Engineer, MS SQL certified MCSA / MCSE, with 14 years of experience writing SQL queries, reports/dashboards design and construction, database administration, data warehousing, and database related projects and tasks. I am a near-native English speaker, currently available, business-savvy, and results-oriented. I can create your triggers and log table, ensuring the robustness, security, good performance, and ease of understanding of the solution. I have all the software required to do the job. We can discuss details over chat if you need. Thanks! Sergio
$150 USD in 1 day
4.9 (21 reviews)
5.5
5.5
User Avatar
Hi, hope you are fine. I have gone through your job description, You want to create an audit table where you want to store all the changes made in "tblchild". In short you want to capture all the changes. I'm a Data Engineer with more than 5 years of experience in MS SQL Server. This is something which I have done recently. Along with capturing changes and auditing them I can also provide you an information that which row is deleted, which row is updated and which is inserted. I have one question, What is the version of MS SQL Server which you are using? Looking forward to discuss more about this project.
$100 USD in 1 day
5.0 (9 reviews)
4.6
4.6
User Avatar
Hello, I have 4 years of experience working as a Software Engineer with Microsoft Technologies including .NET Framework and MSSQL 2008-2019. I also have an MSc in Data Science. Thus, I am confident I can complete your task exceptionally well. Please contact me if you're interested, so we can further discuss the task and clarify a few details on how exactly you'd want some things to be done.
$150 USD in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
gaithersburg, United States
5.0
19
Payment method verified
Member since Mar 31, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.