I searched almost everywhere but I couldn't find a solution.
I'm looking for a way to find the last time that user change an option of a filegroup in SQL Server database.
For example, the last time of changing read-only property of a specific filegroup.
Is there any way?
Thanks :)
Thanks for your comments, SQL Server Audit Log solved my problem.
These link about SQL Server Auditing were helpful for me:
Setup SQL Server Audit:
https://solutioncenter.apexsql.com/how-to-setup-and-use-sql-server-audit-feature/
https://learn.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-database-engine?view=sql-server-2017
Read SQL Server Audit Information:
https://solutioncenter.apexsql.com/analyze-and-read-sql-server-audit-information/
Related
Is there any way to do auditing for DML on sql server ??
Appreciate the help that I can get since there is a problem with data that I need to figure out which user that do manipulate the data on various tables , so need to activate the dml audit to include all of the tables in my schema or if possible the database
Regards,
I guess that I fogot to mention that we have sql server 2008 , so I found that most of the features were introduced to 2012 and above , so the solution found is:
CREATE DATABASE AUDIT SPECIFICATION referring to the link
https://msdn.microsoft.com/en-us/library/cc280404.aspx
Regards,
thank you all
I have a two big programs that connect to a SQL Server 2005 database.
Now we will migrate to a new server with SQL Server 2008.. the programs don't work anymore when connected to the new server, the cause is that in all the queries in the programs only table names are used, and they are not dbo tables.. so SQL Server 2008 doesn't recognise them, unless I use the schema name before the table name...
It is very very difficult for me to change all the queries in the two programs to add the schema name before the tables names.
I read in this forum that if I specify the default schema the problem will be solved.. but it haven't been solved though.
The only solution that seems to be working is when I changed the schema of the table to dbo.. but I am not sure if this action will be OK or will it cause some other problems related to this modification?
Is there any better solution?
Will changing the schema of the tables cause me other kind of problems?
Many thanks in advance
Default schemea will work for you. What are the issue with this approach?
Change schema name will cause a big issue and not advisable. Where and how much schema name change?(just think).
You just set a default schema with only one procedure first and check, if this is ok. then change the whole database schema.
https://dba.stackexchange.com/questions/21158/net-sql-server-authentication-schema-issue
In sql server 2005, how do I change the "schema" of a table without losing any data?
Change Schema Name Of Table In SQL
Best practice for SQL Server 2008 schema change
Is it possible to log shipping for few tables only in SQL Server 2012?
Thanks
SImple answer: NO. THere is no per table log. THere is ONE log per database. SImple like that.
You want partial table stuff - only chance is replication.
You can manually configure this using FileGroups (ie. put tables into a different FILEGROUP), and manually manage the restore process.
Initially only restoring the tables you require
Lookup Partial Restore.
This is a currently working.
is there any way to change the master database collation in MsSql server 2008 to another collation, instead of reinstall it ?
You need to rebuild/recreate the master database as described here.
(Though that article also goes through the steps to change all user databases to the new collation you probably just need to follow the steps here)
There is a table in my database containing 100 columns. I want to create a trigger to audit the modification for every update operation.
What I can think is to create the update clause for all columns but they are all similar scripts. So is there any elegant way to do that?
Check Change Data Capture
Update
CDC provides tracking of all details of changes. Available since SQL Server 2008.
(Change data capture is available only on the Enterprise, Developer, and Evaluation editions of SQL Server.
Source: http://msdn.microsoft.com/en-us/library/bb522489.aspx)
More lightweight solution is Change Tracking (Sync Framework), the one code4life mentioned before, available since SQL Server 2005.
Update2:
Related questions (with a lot of sublinks):
History tables pros, cons and gotchas - using triggers, sproc or at application level
History tables pros, cons and gotchas - using triggers, sproc or at application level
Suggestions for implementing audit tables in SQL Server?
Suggestions for implementing audit tables in SQL Server?
Are soft deletes a good idea?
Are soft deletes a good idea?
How do I version my MS SQL database in SVN?
Versioning SQL Server database
Thomas LaRock. SQL Server Audit: Magic without a Wizard
http://www.simple-talk.com/sql/database-administration/sql-server-audit-magic-without-a-wizard/
There's this resource on MSDN which you might find helpful:
Tracking Changes in the Server Database (including SQL Server 2008)
I'm not sure if you're using SQL Server 2008 though.
Code generation?
Have you looked at the techniques which http://autoaudit.codeplex.com/ uses?
Theoretically, you can use 1 trigger and check COLUMNS_UPDATED() to know which columns has changed.
(not be tested)
See more here