Recently in a developer meet, I was asked a question that, “is there a simpler way to have a stored procedure output fill into a table without defining all columns, as simple as like * into #t ?” You must be thinking about OPENQUERY, Continue Reading..
We have been using different methods in SQL to convert row data into columns. Some time it’s just the requirement for data visualisation only. To fulfil this requirement mostly we use PIVOT, which is complex and lengthy. In this blog Continue Reading..
Checking a column existence in a table is very simple in SQL Server, but you should be careful while doing it on Azure environment. We simply ignore the performance consideration while writing SELECTs against systems tables/views/dmvs etc. Recently a stored proc started Continue Reading..
How to generate Fibonacci Series in SQL Server? This is a very commonly asked interview question for SQL developers. I assume you must be knowing what is Fibonacci Series? In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Continue Reading..
Few times I have observed that developers directly consider the dynamic SQL option as a solution, when there is need to sort the result set on basis of user input variables/parameters. Let’s see how can we do the sorting using case when. Continue Reading..
Personally I am very strict to the datatypes, whether it’s for a column or parameter or just a variable. I don’t like if somebody choose them carelessly. Always the datatypes needs to used precisely. Make it as a coding standard or your Continue Reading..
Converting columns into rows in SQL Server is not a new thing, we often face this kind of scenarios. Lets say, there are values in different columns within a table and you want to perform some aggregations on those columns combining them all together or you Continue Reading..
I was working on a data warehouse project where the time data (HH:MM) were coming in decimal format from the source. Some of them were restricted to actual hour and minutes (23.59) and some were coming in real decimal format like (16.80). So I had Continue Reading..
There would be situations where in an application would have developed ages ago not considering to support multi time zone but later you realise and want to handle the same, when the application is already on production for couple of months or years. Recently I had Continue Reading..
Sometimes there is a need to search every field of every table for a particular value in SQL Server database. Recently I had a some requirement to search a value against a Microsoft Dynamics AX ERP database and then replace that value Continue Reading..