Auditing Best Practise

Apr 30, 2008

I want to log all changes made to a table (only updates, since there will be no deletes or inserts).

I would like to see the user who changed it, the date and time, fieldname, old value, new value.
If more fields are changed during the update, than add more records into the logging table.


What is best practise to achieve this?


Thanks,
Frans

View 13 Replies


ADVERTISEMENT

Best Practise Regarding Tables?

Oct 13, 2006

Hi!I have 6-7 tables total containing subobjects for different objects like phonenumbers and emails for contacts.This meaning i have to do some querys on each detailpage. I will use stored proc for fetching subobjects.My question therefore was: if i could merge subobjects into same tables making me use perhaps 2 querys instead of 4 and thus perhaps doubling the sizeof the tables would this have a possibility of giving me any performance difference whatsoever?As i see pros arefewer querys, and cons are larger tables and i will need another field separating the types of objects in the table.Anyone have insight to this?

View 5 Replies View Related

SSIS - Best Practise

Nov 6, 2007

Hi,

I have some data that is updated every day but I don't know when. I'm trying to make a solution that runs a SQL query to check if this data has been updated. If it has, I'll send the updated data with FTP as as text file.

How would you solve this?

My idea is to have 2 SSIS packages.
- Package1: One runs at the same time every day (inserts any missing updates to a table)
- Package2: One runs every hour to check the missing updates table, and runs Package1 if any update for a missing data is found.
My only worries is if Package1 is running and at the same time Package2 decides to run Package1 then I could get into trouble if I'm using temp tables with the same name for the text file updates etc.
Thank you.

View 1 Replies View Related

Best Practise/architecture Question

Jul 27, 2007

I need to load a lot of Excel, CSV, ... etc. files. These files have hundreds of columns and I need to validate the data. Some are simple range type checking, some are more complex checking involve multiple columns.

There may have several hundreds of such rules. And I may need to let the program to automatically correct some invalid data in the future.

Where to implement it in SSIS?
Or just load the files without any checking (all type to text), and checking using T-SQL?

(BTW, I don't have biztalk server).

Thanks in advance.





Read more >> Options >>

View 5 Replies View Related

Upgrading Windows And SQL Server - Best Practise

Feb 6, 2002

Hi Folks,

I am about to upgrade my main database server (5 db's - largest 16Gb) from
NT 4 SP 6a / SQL Server 7 SP3 to Windows 2000 SP 2 / SQL Server 2000 SP 2

I am planning to detach the db's, backup to tape a few times and then totally
trash the server, rebuilding it with the new software, restore the db's from
tape and the reattach the db's.

Any reason I should not use this method and can folk advise the best practice
way of achieving this?

Regards

Paul

________________________

Paul Starling
ERP Database Administrator

View 1 Replies View Related

Best Practise - Advice Needed On SP/Triggers)

Aug 10, 2007

Hi, hoping I can get a few view on a question I have relating to the above.

I am new to Stored Procedures and Triggers and I am trying to understand 'best practice' a little better. Here is my question: If I have a table that stores information, and when any field in that table is updated (and changes) I would like to inactive the row, prior to change and then add the change by way of a new, active row. This way I can see what it was before and that it's inactive, and what the active value is.

Hope this makes sense, if this is the wrong way to manage change history any suggestions would be appreciated.

A second question I have is as follows: If I have a table that stores a number, based on that number, what would be the best way to create new records in a different table that pulls from the first table. Where the number stored in table 1 represents how many times the record is to be created in the second table.

Thanks. If anyone needs more data, please feel free to ask, I will help as best as I can and appreciate any advice & comments that you can give.

Paul

View 3 Replies View Related

Best Practise To Import XML Into SQL Server 2005

Jun 15, 2007

As title, what's the best practise of importing XML data into SQL Server 2005?

I have found this one. http://support.microsoft.com/default.aspx/kb/316005. Is it good enough?

The XML is generated by another system on daily basis. So, the import should be able to handle insert and update cases. How can I do that? Thanks!

View 2 Replies View Related

The Fastest Normal ADO.NET Or Microsoft Best Practise EnterpriseLibrary

May 12, 2006

So I got 2 classes one I wrote to interrogate databases using normal ADO:Mine:SqlConnection myConnection = new SqlConnection(m_sConnectionString);SqlCommand myCommand = new SqlCommand(sQuery, myConnection);myCommand.CommandTimeout = 120; // 60 Seconds TimeoutmyConnection.Open();SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);return result;Microsoft WaySqlDatabase dbSvc = new SqlDatabase(m_sConnectionString);DbCommand dbCommand = dbSvc.GetSqlStringCommand(sQuery);return ((SqlDataReader)dbSvc.ExecuteReader(dbCommand));What's faster?My way:SqlConnection myConnection = new SqlConnection(m_sConnectionString);SqlCommand myCommand = new SqlCommand(sQuery, myConnection);myCommand.CommandTimeout = 120; // 60 Seconds Timeout// Use a DataTable – required for default pagingSqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);DataTable myTable = new DataTable();myAdapter.Fill(myTable);myConnection.Close();myConnection.Dispose();myConnection = null;return (myTable);Microsoft Way:SqlDatabase dbSvc = new SqlDatabase(m_sConnectionString);DbCommand dbCommand = dbSvc.GetSqlStringCommand(sQuery);DataTable dtData = null;DataSet dsData = dbSvc.ExecuteDataSet(dbCommand);dtData = dsData.Tables[0];return (dtData);Comments? Ideas?Al

View 4 Replies View Related

Basic Advice On Good Practise Required

Mar 5, 2007

I have master tables that I will be updating from our ERP system. Some examples I have seen take an approach of dropping a table in SQL server then creating it again before importing; some, and probably my choice, append and update; I have not seen an example where records are all deleted then the data appended afterwards. Of the three approaches which is generally regarded as best practise / most efficient?

View 1 Replies View Related

Database Development/Deployment Best Practise For Large Teams

Jan 2, 2008

Hi,
I work with a large team developing ASP.NET application that has a large database with over 50 complex stored procedures.  It is proving more and more difficult and time consuming to centralise the development and update of the database changes and I was wondering if there were any best practises/tools that could be recommended.  I have looked on the web for good articles and haven't found anything difinitive (except that Team Foundation Server is the way forward)..
A brief background to the current process is that everyone develops on the same database, and then updates the stored procedure scripts in source safe (manually).  Then when we do a new release someone builds a script of all the database updates and runs it.  There are issues related to developers updating there stored procedures over other peoples and other concurrency.
I am looking to move all the developers to start using local databases so that there work only effects them, but then this brings up problems of keeping all the local databases up to date whenever they get the latest source code.  The only way I currently see is to build a database update program, that will run and update to the latest version.
Surely this must be a common issue?  Anyone have any good ideas/concepts?
Also our setup is Visual Studio 2005, SQL Server 2005 and Source Safe 2005. 
Cheers,
 Andrew Thomas

View 5 Replies View Related

Auditing DB Changes

Sep 1, 2005

It seems to me there are two common strategies for doing DB audit trails via a trigger:

1. On an update to a row, duplicate that row in another table with
identical rows, except for perhaps the extra columns which represent
change date and changed by. Eg. When there is an update to the Customer
table, record the changes in Customer_Audit.

2. On an update to a row, check which fields were updated. Then in a
common audit table record the table, row ID, field, previous value and
new value of the field.

I'm wondering about the pros and cons of each. More specifically, do
the pros and cons change if you are using an O/R mapper (I'm using
NHibernate.)

Some thoughts on method 1 . It seems nice for an O/R mapper, since you
could have, say, a CustomerAudit Object inherit from your Customer
object and just add the properties change date and changed by. A
problem with this is you're going to add a whole lot of objects - one
for each object which you want to audit. Another drawback is that it
could be difficult to generate a history for a particular property
which was updated. Let's say I want to see the history of changes to
the customer's status. I have to load a collection of CustomerAudit
objects (which could be costly). Then I have to iterate through them
and compare the status properties to generate a history of statuses.
This is a pretty labor instensive method if you compare it to method 2,
where the change is recorded by field, not row.

Some thoughts on method 2. It's nice since the changes are by field,
not row, which (as above) makes generating a history easy. On the other
hand, you can never have a snapshot of a particular object at a
particular point in time. Moreover, I'm not sure how foreign keys would
be handled elegantly. I record that customer.statusID changes from 3 to
6. I'd have to do a seperate join to the customerstatus table to get
meaning for 3 and 6 (which method 1 would do automatically).

Thoughts? Any preferred way to do this with an O/R mapper?

Thanks

View 1 Replies View Related

Auditing

Mar 18, 2002

Hello,

I'm working on Sybase and recently started working on MS SQL Server. Can anyone guide me how to set up auditing for errors whether fatal or not?

Any help is appreciated

Thanks
Dinesh

View 1 Replies View Related

Auditing In SQL 7

Jun 29, 2000

A few days ago I saw a article on the internet (i don't know where), which described a way for auditing all database activities (like deleting records per user etc.) Unfortunally I can't find this document. Can anyone help me with this?

View 1 Replies View Related

Auditing DTS

Aug 18, 2003

how to audit DTS ?
80 % of DTS run from
exec master..xp_cmdshell 'dtsrun ....

20 % started by server agent

I have list with 200 DTS
I want to delete dts that are not in use.
Can I use profiler or it its possible to get info from system tables?

Thank you

View 1 Replies View Related

Auditing

Mar 18, 2002

Hello,

I'm working on Sybase and recently started working on MS SQL Server. Can anyone guide me how to set up auditing for errors whether fatal or not?

Any help is appreciated

Thanks
Dinesh

View 1 Replies View Related

Auditing

Aug 31, 2007

Guys,

We looking to audit tables in the database. In the tables auditing needs to be done only on few columns not all the columns. Is there any 3rd party tool available to do it can it auditing be done on columns only with sql server 2005. Trigger doesnt work in this scenario as it works per row it does not say which column in the row was updated/inserted/deleted.

For example in the below employee table, I want to audit(history) only ssn and dob columns - all the updates/inserts/deletes made to this column should be audited.

empidempname ssndob
1John,smith 122222222 07/29/2001

Any suggestions and inputs would help

Thanks

View 2 Replies View Related

Auditing A Table

Sep 19, 2001

I have a table and the data in this table (for no rhyme or reason)is being deleted somehow. I'm looking for suggestions on how to audit this table and find out who or what process could be deleting my data.

View 3 Replies View Related

Auditing On Sql Server

Jun 14, 2000

Hi,
i need to set up some security standands in sql 6.5/7 . These includes auditing login attempts success and failure, access to db objects etc. I know sql is has very limited capabilities . can anyone tell me how to implement this without using event viewer etc??

View 2 Replies View Related

MSSQL 6.5 Auditing

Oct 20, 1999

Hi folks. I am a new DBA and working on taking over several existing MSSQL 6.5 applications.

My company needs to be able to audit the following actions on MSSQL.

login
logout
insert into specific tables
update in specific tables
delete from specific tables

I am looking for a 3rd party product that provides these services for SQL 6.5. I have found Braintree products and they have really nice auditing but for Oracle and not MSSQL. I have also looking into using triggers to build an audit log for me but the applications we are using require periodic updates that would force me to rebuild the triggers. This may cause too much administrativia.

Any Ideas?

Thanks, Aaron

View 2 Replies View Related

MS SQL Server Auditing

Nov 14, 2006

I want to know are there any other third party tools that are used for Auditing the SQL Server Like...DBAudit.

View 2 Replies View Related

Server Auditing

Sep 23, 1998

Hi all:

I need some help with this. I have a development server and all the developers log in as sa. Lately test data has been mysteriously deleted from selected tables. I need to track the time that the activity is taking place so I can figure out who might be playing this little game. Can anyone suggest what I can do to find this out? Your quick response will be appreciated.

View 3 Replies View Related

Auditing Sa Activities

Jun 24, 1999

Someone had changed the SA password on one of my servers. I need to find out who did this. Can you tell me if there is any historical information kept on any of the system tables that can tell me who (what machine name) and when (date and time)this was done?
Does anyone have a 3rd party or inhouse developed task/procedure to report this kind of security issues?

View 1 Replies View Related

Auditing Trigger

Mar 20, 2006

hey all, i found this auditing trigger, currently it just kicks out what was changed and when, id like to add who cause the trigger to fire as well (currently its just set to the "inventory" table). check under the "add the audit fields" comment for info:

CREATE TRIGGER TRG_inventory
ON [DBO].[inventory]
FOR DELETE,INSERT,UPDATE
AS

DECLARE @ACT CHAR(6)
DECLARE @DEL BIT
DECLARE @INS BIT
DECLARE @SQLSTRING VARCHAR(2000)

SET @DEL = 0
SET @INS = 0

IF EXISTS (SELECT TOP 1 1 FROM DELETED) SET @DEL=1
IF EXISTS (SELECT TOP 1 1 FROM INSERTED) SET @INS = 1

IF @INS = 1 AND @DEL = 1 SET @ACT = 'UPDATE'
IF @INS = 1 AND @DEL = 0 SET @ACT = 'INSERT'
IF @DEL = 1 AND @INS = 0 SET @ACT = 'DELETE'

IF @INS = 0 AND @DEL = 0 RETURN

IF NOT EXISTS (SELECT * FROM SYSOBJECTS WHERE ID = OBJECT_ID(N'[DBO].[AUDIT_inventory]') AND OBJECTPROPERTY(ID, N'ISUSERTABLE') = 1)
BEGIN
-- CREATE A MEMORY TABLE CONTAINING THE FIELDS AND TYPES OF THE TABLE
DECLARE @MEMTABLE TABLE
(
ID INT IDENTITY
,COLUMNAME SYSNAME
,TYPENAME VARCHAR(20)
)
-- INSERT THE COLUMNAMES AND THE DATATYPES
INSERT @MEMTABLE
(COLUMNAME,TYPENAME)
SELECT NAME,TYPE_NAME(XTYPE)
FROM SYSCOLUMNS
WHERE ID = OBJECT_ID('[DBO].[inventory]')
ORDER BY COLID

DECLARE @CUR INTEGER
DECLARE @MAX INTEGER
DECLARE @SQLSTR AS VARCHAR(8000)
DECLARE @CURCOL SYSNAME
DECLARE @COLTYPE AS VARCHAR(10)

-- SETUP VARIABLES
SET @SQLSTR = ''
SET @CUR=1
SELECT @MAX = MAX(ID) FROM @MEMTABLE

-- LOOP EVEY FIELD
WHILE @CUR <= @MAX
BEGIN

-- GET VALUES FROM THE MEMTABLE
SELECT @CURCOL = COLUMNAME,@COLTYPE = TYPENAME FROM @MEMTABLE WHERE ID = @CUR
IF @COLTYPE = 'INT' OR @COLTYPE = 'BIGINT' OR @COLTYPE='UNIQUEIDENTIFIER'

-- WE DO WANT TO COPY INT/BIGINT/UNIQUEIDENTIFIER FIELDS BUT IF THEY ARE AN
-- IDENTITY OR A ROWGUIDCOLUMN WE DO NOT WANT TO COPY THOSE ATTRIBUTES

SET @SQLSTR = @SQLSTR + ' CAST('+@CURCOL + ' AS '+@COLTYPE+') AS [' + @CURCOL +'] '
ELSE

-- ANOTHER FIELD DO NOTHING JUST COPY IT AS IT IS
SET @SQLSTR = @SQLSTR + ' '+@CURCOL + ' AS [' + @CURCOL +'] '
IF @CUR <= @MAX - 1 SET @SQLSTR=@SQLSTR + ','
SET @CUR = @CUR + 1
END

-- ADD THE AUDIT FIELDS
SET @SQLSTR = @SQLSTR +',CAST('' '' AS CHAR(6)) AS TRG_ACTION,CAST(GETDATE() AS DATETIME) AS TRG_DATE ' - tryin to add who made the update here, figure out what GETUSER translates to

-- SET UP THE SELECT FOR CREATING THE AUDIT TABLE
SET @SQLSTR = 'SELECT TOP 0 ' + @SQLSTR + ' INTO [DBO].[AUDIT_inventory] FROM [DBO].[inventory]'
EXEC(@SQLSTR)
END

IF @ACT = 'INSERT' INSERT [DBO].[AUDIT_inventory] SELECT *,'INSERT' ,GETDATE() FROM INSERTED
IF @ACT = 'DELETE' INSERT [DBO].[AUDIT_inventory] SELECT *,'DELETE' ,GETDATE() FROM DELETED
IF @ACT = 'UPDATE' INSERT [DBO].[AUDIT_inventory] SELECT *,'UPDATE' ,GETDATE() FROM INSERTED

View 10 Replies View Related

Transaction Log Auditing

Jul 20, 2005

Is there a tool that can report transaction log information? Such asreporting what tables/columns were updated, by whom and when,etc....Thanx.

View 1 Replies View Related

Best Way Of Auditing Data

Oct 10, 2007



Hello
I am more of a reporting person, recently I was asked to create stored procedure for an upcoming ASP.NET
application.
We have a problem that we are facing and any suggestion would be very helpfull.

The problem is that we have like 8 differtent tables each with 10 to 15 columns in it.
The front end application has pages with save , update , delete button which are insert,update,delete
for each of the 8 tables
i.e they save , update , delete these 8 tables

They want to a way to Update , this audit table which stores information
like ---

Date
User
Table
Column name
Previous column name
new column name

So for each row that was updated in those 8 tables , each column will have the above fields updated as a row of data

Initially we thought about triggers but it will be like 60 triggers ...Is there a better or other way of handling this?



Any help is appreciated
Thanks

View 3 Replies View Related

Auditing Trigger

Apr 17, 2008

Hi


I would like to create a simple trigger on a Customer table to fullfill two fields, on should be filled when a new customer is inserted (DateAdded) and the other when the customer is edited (DateEdited), Yes I know it is quite simple but as I am not a database expert I do not know how to solve this problem.


Thank you in advance.

View 11 Replies View Related

C2 Auditing Documentation

Sep 20, 2007

Hi everyone,

I am to try to find documentation about C2 auditing into SQL Server 2005. The only one doc I fand about it is:
SQL 2000 C2 Admin and User Guide
It cover SQL Server 2000 and Windows NT4.0.

I do not find any document who cover the security from SQL Server 2005.

Can you help me please?

Thx.

Laurent

View 1 Replies View Related

Sql Server 2k Auditing

Oct 20, 2007

I'm wanting to do some auditing with sql 2k and wish to get the users first and last name of the windows account to log into a table. You can easily access the windows account name by using the System_User keyword. However, is it possible to get the first and last name of the system_user? If so, how?

Thanks.

View 10 Replies View Related

SSIS Auditing Example

Dec 14, 2006

Greetings SSIS friends,



Do any of you guys have a link to a website with an example of how to create a solid audit system for SSIS packages?



Thanks for your suggestions in advance.

View 14 Replies View Related

Auditing Data Changes

Jun 14, 2007

I am using the SCD Wizard and it is working nicely. Can someone point be to an article/tuorial that would explain how you could create an "audit trail" on the items that may have been changed (type I and II)?



Basically, what I want to be able to do is run a query that tells me what data may have changed. I figured I would have to create an auditkey field in my table which would then link the key to the change detail?

View 7 Replies View Related

Setting Auditing On

Aug 29, 2007

I am trying to write a t-sql query that will work on sql server 2000/2005 that will tell me if auditing is turned on and what it is set to. Have any of you ever come accross a script or SP that can do this?
-Kyle

View 1 Replies View Related

Auditing On SQL Users...!

May 12, 2008



Hi,

we have database and sql login TESTUSER that all front end application (VB6) user as sql user to be able to communicate with DB. we have around 30+ users machine that is running that front end application.....!

how would i do auditing (who change what data and when, etc, etc) on each user action if needed. for that do i need 30+ unique users for each machine.

Thanks,

View 7 Replies View Related

SQL Server Auditing

Mar 13, 2008

Does anyone have a query to determine if auditing is turned on and what it is set to (It needs to be set to failed logins)? Also where the log directory is going? I need the query to work on both SQL Server 2000 and 2005 servers. Any help is appreciated.
-Kyle

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved