What’s New in SQL Server 2014
Here is great presentation/demo about new features in SQL Server 2014. [su_youtube url=”https://www.youtube.com/watch?v=YF9Kidp7qmI” width=”400″ height=”340″]
Here is great presentation/demo about new features in SQL Server 2014. [su_youtube url=”https://www.youtube.com/watch?v=YF9Kidp7qmI” width=”400″ height=”340″]
Northwind is my favorite database for trying out sample T-SQL scripts because of its simplicity. Here is the full script you can just copy/paste and run in SSMS (for sql server) or SQL Developer (for oracle) to create Northwind database …
Northwind Database Creation Script for SQL Server and Oracle Read more »
Just came across very interesting scenario where I had to consume JSON data in SQL Server. Yes I can write C#/VB.net code and load JSON to SQL Server and go from there but what if I have no expertise in …
Consuming JSON data in SQL Server and SSIS, convert JSON to XML Read more »
Here is simple query which shows simple technique to exclude duplicate records from output. In my example I am selecting only first record from duplicate list based on Primary key. Select * into #tmp1 From( select 1 as id,'aaa' as …
If you ever store HTML or XML text in SQL Table ? Then in many scenarios you need to encode string before storing to database so when you display that text in browser it shows up correctly. Here is small …
If you ever try to update several millions of record in single Update statement then think several times because it can cause real pain. Disadvantage of single Update statement is … Its considered as single transaction and it doesn’t commit …
Here is reusable function which can be used to format SQL dateTime to any format like C# or VB.net DROP FUNCTION dbo.fnFormatDate GO CREATE FUNCTION dbo.fnFormatDate (@Datetime DATETIME, @FormatMask VARCHAR(100)) RETURNS VARCHAR(100) AS BEGIN DECLARE @StringDate VARCHAR(100) SET @StringDate = …
T-SQL Date Format Function – fnDateFormat like .net Read more »
If you ever tried to cast string to XML data type in SQL Server then you may encounter this error select cast(xmldata as XML) from XMLFiles Msg 9402, Level 16, State 1, Line 1 XML parsing: line 1, character 54, …
unable to switch the encoding error with XML Data type Read more »
Consider scenario where you want to populate missing data from previous date when data was available. In the following example we want to populate price of orders from most recent previous date when price was available. create table #orderinfo ( …
How to backfill data using SQL – populate missing values from historical data Read more »