Hi Folks -
I am using SQL Server 2008 R2 and trying to shrink the Transaction log and it has completely changed from SQL Server 2005. Does anyone know the SQL script to shrink the transaction log for SQL Server 2008 R2.
Any help is highly appreciated.
SB.
0
Comments
Trying that now I was trying to reconstruct the Query I always used for this, but I read the help topic "How to: Shrink a File (SQL Server Management Studio)" and saw you can use a task from the UI of SSMS:
1. In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.
2. Expand Databases and then right-click the database that you want to shrink.
3. Point to Tasks, point to Shrink, and then click Files.
4. Select the file type and file name.
I applied it to the log file and ... it was shrinked.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
Shrinking the logfile can create fragmentation on the disk.
So: before you shrink your logfile: how big is it and how much data contains your DB?
If you logfile is bigger than that, it might be a good idea to shrink it a little. Generally I try to create a logfile that is +- the size of the data in the database to be sure that a complete rebuild index can be done without growing the logfile.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!