Entries in the ‘sql’ Category:

Shrink / Truncate Log File On SQL Server 2008

The common T-SQL script to shrink/truncate log file is using the script below 1 2 3 USE [foo] GO DBCC SHRINKFILE(foo_log, 1) But, if the script run on SQL Server 2008 instance, resulting that the log file still have the same size. In other word you cannot shrink the log file. To solve the issue [...]

Tags: , , , , , , , , , ,

Leave a Comment

CURSOR FETCH on SQL Server

although CURSOR and FETCH is classified as ‘evil‘ in SQL server, but sometimes we cannot avoid using it. Cause in some scenarios, pivot and other similiar method to perform looping and transformation is not sufficient enough. here’s a link of good example implementing cursor. all example copy from microsoft sites, http://msdn.microsoft.com/en-us/library/ms180152.aspx

Tags: , , ,

Leave a Comment

Kill a lock process

The last method (workaround) to solve a lock status is by killing the process. Write this line to Kill a process in sql server: 1 2 3 4 –This example shows how to terminate SPID 55. KILL 55 –This example generates a status of the rollback process for the specific spid. KILL 55 WITH STATUSONLY [...]

Tags: , , , , ,

Comments (1)