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.

SELECT * vs SELECT 1 with EXISTS

Often, I see in articles and code a query using the EXISTS logical operator and a Subquery within the EXISTS using SELECT *. Typically this is an area where it’s been instilled in me to use SELECT 1 instead of SELECT * for performance reasons. However, is it a myth or is it reality that SELECT * vs. SELECT 1 will make an impact to performance when used in the EXISTS logical operator? The best way to find the answer is to take a closer look.

Read More...

Future, Career and Success – BlueMetal Architects

Every now and then, it’s important to sit back and reflect on what you’ve accomplished over time. Doing so can be an extremely effective motivator and professional development step to pushing yourself to accomplish more. Over the last few years, I’ve been fortunate to accomplish many really cool things and meet many milestones in my career. My involvement in the SQL Community is always a top accomplishment and I enjoy sharing with others the SQL Server and Professional Development skills I’ve gained. I’ve been absolutely honored to have worked on three books, written many blogs, and have articles professionally published. I’ve worked with clients that have exposed me to landscapes I could only have dreamed existed in a mock lab setup.

Read More...

Removed Replication – rowguid added back

When replication features are used in a database, tables that are part of the publications may be altered. In particular, Merge and Transactional Replication require either a Primary Key or UNIQUEIDENTIFIER column in order to function correctly. In order to manage a change capture -not to be confused with Change Data Capture (CDC) – a unique value is required for every row in a table so replication knows what changes to replicate. Indexing these columns is a highly recommended practice as replication relies heavily on reading data from the tables that are being replicated. The execution plans that are generated from those reads should be as optimal as possible.

Read More...

VB.Net make one thread wait for the next now with Async Await

In my [previous post][1] I showed you how to use threads wait fro one another. But of course in VB11 we can also use Async Await out of the box. First of all let’s reproduce what we had with Async Await. I came up with this. I did not try this with lambdas (not even sure that would be possible for now). Imports System.Threading Module Module1 Sub Main() Method1() Method2() Console.ReadLine() End Sub Private Async Function Method1() As Task Console.WriteLine("waiting") Await Task.Delay(2000) Console.WriteLine(1) End Function Private Async Function Method2() As Task Console.WriteLine(2) End Function End Module That gives us.

Read More...

VB.Net make one thread wait for the next

Yesterday we got a question on the VBIB.Be forum (dutch) about threading. The OP wanted to have one thread wait for the next. The problem with threading is that it is complicated. And that there a re more than one way to solve your problem. And the optimal solution highly depends on the specific problem at hand. The solution to his problem, have 1 thread wait on 1 other thread until the 1st thread is finished doing what it must be do, is pretty simple and straight forward. And I know you all want me to tell you about it.

Read More...

SSMS Add-in for Plan Explorer Update

It isn’t very often I’m left speechless at the efforts a company and team will go through to make their customers truly, 100% pleased with a product. Tonight was one of those times. Yesterday, October 15th, I published a review of the new Plan Explorer Pro from SQL Sentry, “Plan Explorer Pro – First Glance". I already take every chance I get to show off Plan Explorer and relay the value it holds to both, DBAs and Developers. With the Pro edition there are features added that really stepped it up to a new level. If you haven’t, go out and read about it, download it, use it! In my review, there was really only one thing I found that I a bit bummed about – the SSMS Add-in for Plan Explorer didn’t work with the new Multi-tab feature in the Pro Edition. Well, it’s October 16th and to my amazement, the SQL Sentry team took that feedback and ran with it to the point, there is an update to the SSMS Add-in and Plan Explorer to make them work together with the multi-tab feature.

Read More...

Plan Explorer Pro – First Glance

Over these past few days, I’ve had a chance to check out the new release of Plan Explorer Pro from SQL Sentry. I’d like to thank them again, for giving me the chance to dig into this new edition and make full use of the additional features it has to offer. As with any software, there are pros and cons to what you can do with it. Let’s face it, not everyone can be fully satisfied 100% of the time. That is, however, the cool part of the evolution of software tools; evolving to meet that 100% goal of full satisfaction across the board. With Plan Explorer Pro, I honestly had a hard time finding anything to really throw on the con list. That is probably due in part to the free version of Plan Explorer already being one of my valued and most effective tools I have in my bag of tools to assist in how I perform daily tasks as well as enhance demonstrations and training sessions. For today, let’s take a quick look at a few of the features the Pro edition has to offer and why I think it’s well worth, if not worth more, the cost it takes to land it installed on your machine(s).

Read More...

Ncrunch goes commercial

I’ve been using the beta of NCrunch for a while now and have been pretty happy with it. It has been “free” up until now. But the time has come for the developer of this product to make some money out of this. And we can only applaud that. Giving away things for free is one thing but it won’t last. We are not yet in the ideal universe Star Trek wants us to believe is coming in the future. In the long run someone will have to pay for all the work that has gone in to this. And Remco Mulder has chosen this path.

Read More...

Why does sys.dm_exec_requests not show my SPID?

This morning, like many other mornings, I ran sys.dm_exec_requests to check for an open transaction. This was due to an application faulting and leaving an update in an uncommitted state. Ignoring the concept of why this happened and the transaction isn’t rolled back as typical when a connection is forcibly closed, sys.dm_exec_requests, introduced with the new metadata in SQL Server 2005, is usually the first DMV I run. Usually, after I run the DMV, I yell at myself and go to others. This is why.

Read More...

Another obscure difference between C# and VB.Net you probably don’t know about

I heard about this one on twitter from David Tchepak the author of [NSubstitute][1]. He referred to [a question][2] they got on the Google groups for NSubstitute. The question is this. 1/ Create a new empty project (console application is ok) 2/ Add a single line in Main: Dim x As Castle.DynamicProxy.IProxyTargetAccessor Obviously this don’t compiles. 3/ Install NuGet package of Castle Windsor (3.1.0) Now, previous code line already compiles.

Read More...