Showing posts with label SQL server. Show all posts
Showing posts with label SQL server. Show all posts

19 February 2013

Successfully Shrink Database Log File (*.ldf) in SQL 2005

This may also work in other versions of SQL, but I've not tested it.

First, back the database up. I'm assuming you can figure out the details of backing up. I normally backup to disk and create a new file for the backup in a set backup location/drive/disk.


Then, set the database to use simple backup mode, as seen in the drop-down list in the image below.


Finally, shrink the database, ensuring you select the Reorganize files... option. Select a minimum freespace of anywhere from 0 to 20. If it is low, you are likely to see some instant growth in your database. If it is too high, you're wasting space.




18 December 2012

How to Determine SQL Version and Edition

To determine what SQL version and edition you have, connect to the instance of SQL Server, and then run the following query:


SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Also, see here to determine the common name for the version you have: http://sqlserverbuilds.blogspot.co.nz/
Props to the team and community that keep that site updated.

Reference:
http://support.microsoft.com/kb/321185
http://sqlserverbuilds.blogspot.co.nz/