Monday, October 12, 2009
How to identify your SQL Server version and edition
Friday, September 25, 2009
Shrinking the Transaction Log in SQL Server
Shrinking the Transaction Log in SQL Server 2000 / 2005 with DBCC SHRINKFILE
SQL Server 2000
1. | Run this code: DBCC SHRINKFILE(pubs_log, 2) NOTE: If the target size is not reached, proceed to the next step. |
2. | Run this code if you want to truncate the transaction log and not keep a backup of the transaction log. Truncate_only invalidates your transaction log backup sequence. Take a full backup of your database after you perform backup log with truncate_only: BACKUP LOG pubs WITH TRUNCATE_ONLY -or- Run this code if you want to keep a backup of your transaction log and keep your transaction log backup sequence intact. See SQL Server Books Online topic "BACKUP" for more information: BACKUP LOG pubs TO pubslogbackup |
3. | Run this code: DBCC SHRINKFILE(pubs_log,2) The transaction log has now been shrunk to the target size. |
- Back up the transaction log file to make most of the active virtual log files inactive. Therefore, the inactive virtual log files can be removed in a later step. To do this, run a Transact-SQL statement that is similar to the following Transact-SQL statement.
BACKUP LOG
Note In this statement,
For example, run the following Transact-SQL statement.
BACKUP LOG TestDB TO DISK='C:\TestDB1.bak'
2. Shrink the transaction log file. To do this, run a Transact-SQL statement that is similar to the following Transact-SQL statement.
DBCC SHRINKFILE (
Note In this statement,
3. If the DBCC SHRINKFILE statement does not shrink the transaction log file to the target size, run the BACKUP LOG statement that is mentioned in step 1 to make more of the virtual log files inactive.
4. Run the DBCC SHRINKFILE statement that is mentioned in step 2. After this operation, the transaction log file should be similar to the target size.
Wednesday, June 17, 2009
Running IIS and SQL server in same machine with diferent IP and Same Port
Monday, January 5, 2009
Model Popup (Ajax Control Toolkit) and ASP.MVC
Model popup is another usefull tool in web applications. Therefore I thought to create easy way to include Model popup in ASP.NET MVC Projects as Stephen Walther (ASP.NET MVC Tip #36 – Create a Popup Calendar Helper) did for Calender Control.
Added Following Class ModelPopupExtensions
1 | using System; |
Added New overloaded method to the AjaxExtensions class. This method takes an extra parameter for properties.
1 | public static string Create(this AjaxHelper helper, string clientType, string properties, string elementId) |