Entries in the ‘sql’ Category:
filed in sql on Jun.30, 2010
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: 2008, dbcc, full, microsoft, recovery mode, shrink, simple, sql, sql server, sql server 2008, truncate
filed in oltp, sql on Jun.22, 2010
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: cursor, fetch, sql, sql server
filed in sql on Jul.18, 2008
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: kill, lock, process, sql, sql server, sql server 2000