Quite often in T-SQL the first thing that comes to our mind when we hear about FOR XML PATH feature is the ability to concatenate row values using it to create a delimited list of values. I myself had blogged…
T-SQL Tips: Swap The Year Value of a Date
Here’s a quick T-SQL tip for you.Suppose you want to swap the year part of a date value in SQL server. Here’s a quick and simple way in which you can do it.Lets consider the below example DECLARE @DateValue datetime ,@SwapYear…
T-SQL Tips: Get The Weekday Number of the Month
I’ve added a new utility function in Technet Wiki to retrieve the number of week day for the month for the date passed ie say 13 Apr 2014 is 2nd Saturday,15th jan 2013 is 3rd Tuesday etc. Do check it…
SSIS Tips: Implementing Conditional Logging
The impetus for this post comes from a recent conversation I had with one of my colleagues. He asked me whether we could implement logging conditionally for a SSIS package. I told it should be possible keeping in mind that…
Excel Tips: Issue with CSV Data Merging Inside Single Column in Excel
This is a really quick tip in Excel while opening CSV filesYou’ve different methods available for the data export to csv like bcp,OPENROWSET etc.One issue that I came across recently in this was the CSV file after getting generated, if…
Checking for Integer or Decimal values using ISNUMERIC
Thanks to Erland I learned a cool way to validate integer or decimal values from varchar field having intermixed data which I’m sharing through this blog.ISNUMERIC was a function which was always thought to be unreliable due to various formats in…
SSRS Tips: Demystifying Top N Bottom N filter
The purpose of this post is to clear the confusion regarding the behavior of Top N & Bottom N filter option available in SQL Reporting Services (SSRS).Couple of days back I came across a post in one of the public…
CASE Expression Issue in Linked Server Query
This blog is to explain a limitation with CASE ..WHEN construct when used in a linked server query which I recently came across.So the scenario was this. I had a table in a remote SQL Server instance from which I…
T-SQL Tips: Get Business Weeks For a Month
Recently in one of my reporting projects, we required generating a list of business weeks along with the start and end dates for a given month so as to consolidate the data and do some weekly calculations on it. I…
SSDT Tips: Display Precedence Labels in SSIS 2012 Packages
Here’s a quick tip regarding SSIS development using SQL Server Data Tools 2012Couple of days before I heard one of my fellow teammates complaining about difficulty in identifying type of precedence constraint in SSIS like whether its for success,failure etc.…