How to Make Database Read Only on SQL Server 2005 and 2008

Posted on

We have an old version of payroll program that contain employee data from year 1998-2004 no changes to this data, HR staff only need to look up old data from here but yes they still needed.

Because of this I need to make the database read only and this can be achieved by following command:

USE [master]

GO

ALTER DATABASE [Payroll] SET READ_ONLY WITH NO_WAIT

GO

If you want to make it read and write:

USE [master]

GO

ALTER DATABASE [Payroll] SET READ_WRITE WITH NO_WAIT

GO

 

On the other hands we also have a new version of Payroll program that contain data from 2005 up to now.

The funny thing is that although we made the software from the same company they don’t support the old version anymore because all the developers is not there anymore, and they also refuse to combine the old database with the new one because the structure is different.

The software company also seek an excuse that the database size will be huge. The old data size is about 12GB with about 6000 employee data. While the new database size is about the same size with 3000 employee data.

If you found that your LDF file is too big, you can shrink it in easy way here:

http://yunarwinardi.com/sql-ldf-file-too-big-this-2-easy-steps-will-fix-it/

 

Facebook Comments