Export SQL Table or a Query data to JSON string format | SQL Server 2016

As many of you know that in SQL Server 2016 there will be support for JSON data, and with the release of CTP2 you can play with the some of the features of JSON, but with CTP3/RTM JSON will be fully supported.   – With this CTP2 release you can only export data as JSON string. – But with…

1

Maintaining Uniqueness with Clustered ColumnStore Index | SQL Server 2014

Column Store indexes were introduced in SQL Server 2012 with a flavor of Non-Clustered index i.e. “Non-Clustered ColumnStore” index. However there is a big limitation that the underlying table becomes read-only as soon as you create one. In SQL Server 2014 this behavior is unchanged and addition to this you can also create ColumnStore index as a Clustered index. And the good thing…


Top SQL Blogs – Windows 8 App | from MSDN, MVPs and Top Bloggers

After I published my first App [SQL with Manoj] on Windows 8 Store, I thought to create an another App at a broader level, which will cover latest SQL Server and TSQL topics from MSDN blogs, MVPs and other famous Bloggers, like Paul S. Randal, Kimberly Trip, Sam Lester, Brent Ozar, etc. And today I’m very happy to…

1

Another reason to use THROW clause instead of RAISERROR

In my previous post [link] I talked about the new THROW clause introduced in SQL Server 2012 and how it is different from the existing RAISERROR function. I just stumbled on one more reason to stop using RAISERROR function and start using the new THROW clause. There are some SQL statements that throws more than…

1

New THROW statement in SQL Server 2012 (vs RAISERROR)

The new THROW keyword introduced in SQL server 2012 is an improvement over the existing RAISERROR() statement. Yes, it’s single ‘E’ in RAISERROR. Both RAISERROR & THROW can be used in T-SQL code/script to raise and throw error within a TRY-CATCH block. Check my previous post for TRY-CATCH block, [link]. >> With RAISERROR developers had to…

7

Use new TRY_PARSE() instead of ISNUMERIC() | SQL Server 2012

I was working on a legacy T-SQL script written initially on SQL Server 2005 and I was facing an unexpected behavior. The code was giving me unexpected records, I tried to dig into it and found that ISNUMERIC() function applied to a column was giving me extra records with value like “,” (comma) & “.” (period)….

6

Using FullText search with FileTables in SQL Server 2012

In my previous post sometime back I talked about FILETABLES, [link]. This is a new feature introduced in SQL Server 2012, which is built on top of FILESTREAM. I also talked about how we can use them to store files and retrieve the information from them.   Here, in this post we will see how we can search…

1

SQL Server 2012 (a.k.a Denali) – New feature | FileTables

new kid on the blog… this is my first post on MSDN Blogs after joining Microsoft very recently (Jan-2012). I also used to blog on my personal bog site i.e. http://sqlwithmanoj.com about SQL Server (TSQL) and I’ll start my 1st blog post here by referring to my latest article.   SQL Server 2012 (a.k.a Denali) is yet…

4

DYNAMIC PIVOT

My previous PIVOT UNPIVOT post describes to organize data in a cross tab fashion or to transpose columns into rows and vice-versa. This is fine only when you know how many columns you need. But when columns vary according to the query then how could you apply them on your scripts. The only way is to store…


ISNULL vs COALESCE

ISNULL & COALESCE with some common features makes them equivalent, but some features makes them work and behave differently, shown below.- Similarity:Both can be use to build/create a CSV list as shown below: USE [AdventureWorks] GO DECLARE @csv VARCHAR(2000) SELECT @csv = ISNULL(@csv + ‘, ‘, ”) + FirstName FROM Person.Contact WHERE ContactID <= 10…