LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

The Fujitsu Siemens T1010 A first impression

I have the FS T1010 for 3 weeks now so this is just a first impression. First a little about the configuration, which I think is quite impressive considering its size. It has an Intel P8400 processor on board with 3 GB of Ram and a 300GB HD It gets a pretty good score from the windows experience index, namely 3.8. And this is due to the gaming graphics score. Since this is not a machine you will buy for gaming, it is a non-issue.

Read More...

Hiding the mouse pointer for the tablet pen

I got a new tablet PC and I like it, a lot. It takes a little time to get used to. But now I’m so used to it I can’t live without it any more. Of course it is also very cool. I got the Fujitsu Siemens T1010 with Windows Vista Ultimate on it. I will write about it later. But first I had to solve a little annoyance. Vista likes to add an extra mouse pointer when using the pen/touch screen.

Read More...

Optional and named arguments in C# a comparison with SQL Server stored procs

I was thinking about writing a post about how C# is morphing into SQL because I noticed that C# has added named and optional arguments. Remember the Compound Operators Or How T-SQL Is Morphing Into VB Or C#? This is basically the same kind of thing only it goes into the other direction. For some bizarre reason Chrissie had the same idea yesterday and posted the following post: What so special about Optional/named parameters.

Read More...

What so special about Optional/named parameters

We VB.netters have been having them for years, kinda boring actualy. But I guess you C# guys find them all new and exiting. Here a small number of the blogs in the blogsphere about them. C# 4.0 Optional Parameters and C# 4.0 Named Parameters Named and optional parameters in C# 4.0 C# 4.0 Optional Parameters This works in VB.Net 2008 (VB9) and VB.Net 2010 (VB10). Optional parameters have been in VB for a long time not sure when named parameters came in.

Read More...

Avoid Conversions In Execution Plans By Using sp_executesql Instead of Exec

Yesterday in the Changing exec to sp_executesql doesn’t provide any benefit if you are not using parameters correctly post I showed you that sp_executesql is better than exec because you get plan reuse and the procedure cache doesn’t get bloated. Today I will show you that sp_executesql is better than exec or ad hoc queries when you deal with conversions in execution plans First create this table and populate it with some data

Read More...

Creating a Sequential Guid in .Net

Today I needed to create a sequential GUid in .Net to test if my Compareto function worked as expected. The problem is that Guid.NewGuid produces a random Guid duh. which isn’t sequential. Of course in my unittests I want to know what value I’m giving to the guid. .Net doesn’t have a SequentialGuid function as far as I know So went for a little Google. And I found this site.

Read More...

An arrowhead anti-pattern

This is an anti-pattern. vbnet Public Overrides Function Equals(ByVal obj As Object) As Boolean If obj IsNot Nothing Then If obj.GetType Is Me.GetType Then Return Me._description.Equals(CType(obj, EventItem)._description) Else Return False End If Else Return False End If End Function this is better and gives the same result same vbnet Public Overrides Function Equals(ByVal obj As Object) As Boolean Dim ReturnValue As Boolean = False If obj IsNot Nothing AndAlso obj.GetType Is Me.

Read More...

Changing exec to sp_executesql doesn't provide any benefit if you are not using parameters correctly

Changing exec to sp_executesql doesn’t provide any benefit if you are not using parameters correctly I was looking through some code recently and noticed all these sp_executesql calls which did not use parameters correctly. A typical SQL statement would look like this declare @Col2 smallint declare @Col1 int select @Col2 = 4,@Col1 = 5 declare @SQL nvarchar(1000) select @SQL = 'select * from test where Col2 = ' + convert(varchar(10),@Col2)+ ' and Col1 = ' + convert(varchar(10),@Col1) exec sp_executesql @SQL What that code does is it builds a SQL statement and executes it.

Read More...

Finding motivation after a smack in the face

Today is going to be a hard day as far as motivation goes. I won’t go into details of why that is but I want to write about nonetheless. I’m going to turn the issues around and say how I find motivation in the daily stress of being in a DBA position with great pressure from all around you. First, no matter what you have to feel good about your accomplishments in life.

Read More...

So close and yet…

So Close… And yet so far. I’ll guess I’ll just have to implement it so that I can get to the End sub ;-). And yes even with VB.Net you can get close to 100% coverage.

Read More...