Skip to main content


SQL Performance improvement for User defined table types

Recently, I have dealt with an interesting performance issue with one of my SQL query and thought I will share the experience here. Context: We had a legacy stored procedure responsible for saving large amount of excel row data to our database tables. It was using   User Defined Table Types as one of the parameter to get a list of row data from excel. However, the stored procedure was taking very long time to save the large data set. Root Cause: After quite a bit of investigation using execution plan in SSMS, I was able to narrow down the performance issue to the following: Joining with User defined table type was taking >90 percent of the time A custom hash function which has been used multiple times as a join criteria was also quite expensive to compute. After doing additional research using stack overflow , I was able to figure out that the primary reason for the poor performance doing a  JOIN on Table Valued parameters is that : it does not keep statistics and a

Creating dynamic email templates using C# and Office Outlook

It is quite common for many applications to send automated email notifications. Couple of months ago, I have worked on improving our old email template format to make it more user friendly . In this tutorial I will walk you though regarding how I took advantage of Microsoft Outlook to quickly generate custom email template and later using the html template for building an automated custom email application using C#. Steps: Creating Templates: Using the rich text editor support  in Outlook create a nicely formatted email. Use placeholder text for the values you like to change dynamically based on your task completion status. To keep this tutorial simple, I have created a  simple table with placeholder text inside the third bracket  [place holder text]. However, you can use anything supported by outlook editor. Figure: Email Template Getting HTML code: Send the created email to your own address. After that, open the sent email and right click to view source . It

How to setup remote debugging on a remote machine running within a VM?

This guide will show step-by-step instructions of setting up a remote machine for remote debugging using Visual Studio 2013 Prerequisite: Visual Studio 2013 or later Remote machine running Windows 7 within a VM player Note: Since Visual Studio 2012, Microsoft only supports remote debugging for Windows 7 or newer. To remote debug Windows XP, you'll need to use an older version of Visual Studio and its respective remote debugging tools.  Step-by-step guide: Download and copy the Remote Tools in your Win7 VM. You must get the update version of the Remote Tools for Visual Studio 2013 that matches the update version of your Visual Studio installation. Install the Remote tools in your VM. After installation, run the Remote Debugger  Navigate to Tools->Options Menu Ensure that Windows Authentication is selected. Press OK. Open Visual Studio in your local machine. Make sure you have setup the remote machine in the project you like to remote debug as shown in

Learning WCF

What is WCF? Windows Communication Foundation (WCF) is a framework for building service-oriented applications. It is a unified, simplified and optimized evolution of a number of communication technologies into a single  model. [Ref: MSDN] Why it is important? Enables you to create service oriented applications.  Provide a unified way to communicate with different system. Developers can focus on designing  data and service contracts without having to make prior decisions on which transport, messaging or security protocols and policies to adopt. Allows one to configure service properties such as transport (http/pipes/tcp/Tibco EMS), security models (any of the W3C standards), compression, encoding, timeouts, etc, without changing ANY code.  Learning WCF History Service oriented Architecture [Video] How we end up with SOA? Good Place to Start WCF Basics WCF Hello World Code WCF MSDN Article Intermediate Developer's introduction to WCF Book Learning

Writing better C# code

This post is a collections of articles focusing on writing better C# code. I will update this post as I find more articles. Any suggestions about articles will be highly appreciated.. Some practices to write better C#/.NET code Learn how to make a good code by bad example (Cool!) Designing C# Software With Interfaces Design Pattern Examples in C# Details GuideLine in GitHub

[BUG?] [Using Save as in Windows 7 explorer] Saving a file with a file name same as a folder name within a directory.

I recently encounter this issue while working on a project. I am not sure whether it should be considered as a bug.. probably not.. feel free to throw your opinion How to generate? 1.Open a new word file in Microsoft office 2010/Notepad/Any other text editor. 2.Click Save as option. 3.Try to Save the file in a directory(folder) with some sub directory inside it. 4. Try to save the file with a name exactly the same name as any of the sub directory within that directory. Example: If we have folder name "A" try to save the file named as "A". Actual Result: It actually open the folder that matched with the typed file name instead of saving the file with that name. My Concern: It should allow saving the file instead of opening the folder. [They are different types [directory and single file]. If you later visit that directory and rename the file to the same names as one of the directory it actually works fine with same naming!] Whether it should be consid

Readings of the Day [Oct 20]

[ User Experience] Collections of all the  important articles I have read today  and found interesting are listed here. Inspired by Jason  Haley. 6 Tips for a Great Flex UX: Part 5 Jakob Nielsen's 10 Usability Heuristics for Interface Design