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..
Recently a few of developers started complaining about 100s of database in one instance, making them difficult to navigate in SSMS. This situation is quite generic in all development environment. So here we are going to do a little trick to hide all the databases 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..
Last week a good friend of mine (Parth Shah) asked me a very interesting question that he wants to capture TRUNCATE and DELETE statements being fired on a database with very minimal overhead on the system. When performance is the Continue Reading..
I have seen many times that a few developers like to write SELECT * instead of column names. It’s definitely a bad habit and not the coding standard of-course. Few times I was reverted back saying that the table/view have very few 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 recently had a requirement to round off a decimal value to 0.5 either higher side or lower side. Example: 1.4 the higher side round off should be 1.5 and lower side should be 1 same way 2.7 should round off to Continue Reading..
Actually SQL Server by default does not support content search from PDF files. DMV sys.fulltext_document_types tells us the file types that are supported in your SQL Server instance. To read/index PDF files in SQL Server, we need to load a plugin/class Continue Reading..