Using TRUNCATE_ONLY in SQL Server 2008

After upgrading to SQL Server 2008 from 2005, I got an error with one of my scripts. I am using Sql 2008 SqlExpress 10GB.

This is my T-SQL

BACKUP LOG “pathtomylogfile” WITH TRUNCATE_ONLY;

And I get this error:
Msg 155, Level 15, State 1, Line 1
‘TRUNCATE_ONLY’ is not a recognized BACKUP option.


So I asked myself if there is an option similar to what ‘TRUNCATE_ONLY’ was doing in 2005?
I posted a query at Ask Sql Server Central

I got very nice responses, including a link to this article by Brent Ozar


Check out the responses above, hope it helps you if you are upgrading to Sql Server 2008.
You can also read further on this article on how to configure Sql Server 2008



Google Instant

Google Instant is a new search enhancement that shows results as you type. We are pushing the limits of our technology and infrastructure to help you get better search results, faster. Our key technical insight was that people type slowly, but read quickly, typically taking 300 milliseconds between keystrokes, but only 30 milliseconds (a tenth of the time!) to glance at another part of the page. This means that you can scan a results page while you type.

Got DropBox yet?

Have you heard of DropBox yet? Don’t hesitate to check it out if you haven’t. You sync all of your computers via the Dropbox servers, their basic free service gives you 2Gigs of space and works cross-platform (Windows, Mac, Linux)
It works by behaving like a folder under version control that automatically syncs any time something new is added or modified. It takes care of merging and conflicts without ever bothering you (in case of conflicts, it just shows both files and renames one of them appropriately).

C# extension method similar to Sql’s IN operator

Consider the code snippet below

if(a == x || a == y || a == z)

We can re-write this expression as:

  • Using array’s contains

 if( new [] {x,y,z}.Contains(a))

  • Using a similar syntax for the SQL’s IN operator by using extension

public bool IsIn(this T obj, params T[] collection) {
   return collection.Contains(obj);
}
And invoke as
if(a.IsIn(b, c, d)) { … }

Read more at Stackoverflow

Find the Port a Connection is Using in Sql Server

SELECT c.session_id, c.local_tcp_port, s.login_name, s.host_name, s.program_name
FROM sys.dm_exec_connections AS c INNER JOIN
            sys.dm_exec_sessions AS s on c.session_id = s.session_id
WHERE c.local_tcp_port 1433

I found this very useful when monitoring external access to your Sql Server instance.

The original post was here at SqlServerCentral

Fifa World cup 2010 kicks off today in South Africa

Fifa World cup 2010 kicks off today in South Africa. Yes, it is the first time Africa is hosting the tournament.
Looking forward to an entertaining month ahead and may the best team win.
Talk of favourites in this year’s event, and names like Spain, Argentina, and England and of course the perennial favourites Brazil come up.

At our office, we did a mini Odds/Bets and I was lucky to bet on the following teams as favourites to win the tournament: Brazil, France, Paraguay, Nigeria and Australia.
At least I have Brazil on my pot 🙂

Wish you all the best and may the best team carry the cup!