June 7, 2010 [Volume 2, Issue 12] TSQL Challenge 31 - Managing multiple overlapping date intervals This challenge is adapted from a budgeting system used in a large company to perform quarterly analysis of what kind of work will be done and where it will be done. Project Managers make plans and the estimated...
This is a continuation of my previous blog post, Delimited String Tennis Anyone? , which playfully talked about a virtual T-SQL Tennis match… a friendly rally back and forth between SQL Server MVP Adam Haines and myself in discussing methods of shredding comma-delimited strings in our blogs. In my previous...
SQL Server MVP Adam Haines and I have been going back and forth for months in our blogs on the subject of creating and splitting a delimited string… it’s been kind of a virtual T-SQL Tennis match… not a competition, but rather a friendly rally, knocking the subject back and forth, practicing our skills...
People use Dynamic SQL for various purposes One of the disadvantages of it is SQL injection that can attack your database by doing the things that you didn't want to do Consider a case where usage of Dynamic SQL in unavoidable You have a table that records the daily activities of the employees Your...
The results of a SQL Server SELECT query can be transformed into an XML document by using the FOR XML command. Building XML documents using string functions – concatenating XML tags and embedding values between them using string operations – is not a recommended method. This post tries to look into some...
DateTime is a very useful yet complex datatype in SQL. I have heard many people saying they are not comfortable when it comes dealing with Date calculations. Let us take a closer look at various functions used for date calculations. DAY Returns an integer representing the day datepart of the specified...