Skip to main content

SQL Server 2012: New Features for Developers

Just few days back I have started to work with SQL Server 2012, here I am writing about some of the new features of SQL Server 2012.

SQL Server 2012 does not come with earth-shaking changes but comes with performance improvements, feature improvements and some new features. SQL Server 2012 also brings many new features to the T-SQL language, some of them are listed in this post.

SQL Server Management Studio 2012: SSMS 2012 packs a number of powerful productivity benefits that developers who use SSMS for development tasks will end up loving.  The most obvious change is to Management Studio is that it’s built on Visual Studio 2010(and it has same theme as in figure.) and has the same engine as Visual Studio which means you get a nice WPF experience, better font rendering and CTRL-scroll quick zoom-in/zoom-out.

Being built on Visual Studio 2010 also means that SSMS 2012 picks up Visual Studio 2010's vastly improved multi-monitor support.
SSMS 2012 inherits Visual Studio's Clipboard buffer. This means that you can cycle through previously copied text by holding down the Shift key while pressing Ctrl+V.

Columnstore Indexes: This is a cool new feature that is completely unique to SQL Server. They are special type of read-only index designed to be use with Data Warehouse queries. Basically, data is grouped and stored in a flat, compressed column index, greatly reducing I/O and memory utilization on large queries.

TRY_CONVERT(): TRY_CONVERT is new T-SQL function which returns a value cast to the specified data type if the cast succeeds; otherwise, returns null. You can explore detailed description and example in this post.

Paging : Paging got simpler with SQL Server 2012. Many web applications use paging to show 10 or 50 rows per page and allow the user to scroll through each page of results rather than download the entire set. In SQL Server 2012 the T-SQL syntax has been updated introducing keywords that facilitate a simpler and more efficient paging, keywords such as OFFSET, FETCH, NEXT ROWS and ONLY.  While it doesn’t provide significant performance improvements over the tedious CTE solutions we use today, it certainly makes the code easier to write.

FORMAT() : As its name implies, the FORMAT() function used to make formatting easier, FORMAT() is clearly a much more scalable approach to formatting strings, and is one of the T-SQL enhancements in Denali.  Check out here for more detail with example.

New Logical Functions: There are the two new logical functions in SQL Server 2012: (IIF andCHOOSE)

Sequence: A sequence is a user-defined schema bound object that generates a sequence of numeric values according to the specification with which the sequence was created. Please explore more about Sequence.

File Table: Typically a CMS or some other type of website will allow users to upload pictures, documents etc. Common scenario to save as binary content in the database or other approach would be to store the files on the disk and store related data (filename, extension, length, path etc.), in DB.

SQL Server 2012 offers you the filetable feature. This is a solution built upon the FILESTREAM feature which means storing the binary data outside of the MDF (Main Data File) of the database in order to avoid degrading the performance of the typical structured data. The major benefit of FileTable is it has Windows API compatibility for file data stored within an SQL Server database. With FileTable feature now we can have non-transactional access to files stored in the DB as a windows share along with transactional access via T-SQL. I'll write more about this feature in separate post. You can also check here for more details. 

Happy Programming!!!

Comments

Post a Comment

Popular posts from this blog

Error 405 : ASP.NET Core Web API PUT and DELETE Methods not allowed

Recently, while working with .Net core API I came across the issue of “Error 405 — Methods not Allowed” After some research, I found out that both GET and POST requests working fine but neither PUT nor DELETE requests working. Another thing is that the PUT and DELETE request was also working fine on my local machine but failed when we host on our Azure server. When I explored the issue on the web it led me to the conclusion that WebDAVModule seems to set PUT and DELETE request methods disabled by default and due to that PUT and DELETE throw 405 errors. To make the PUT and DELETE requests work, we need to override the WebDAVModule setting in web.config file by adding the below settings under “ system.webServer ”. < system.webServer >   < modules runAllManagedModulesForAllRequests = " false " >     < remove name = " WebDAVModule " />   </ modules > </ system.webServer > There may be 2 web.config files in y...

C#: Merging Excel cells with NPOI HSSFWorkbook

In this post we’ll see how to merge the two or more cell with each other while creating the excel sheet using NPOI . Mentioned below is code to merge multiple cells, in this example we are merging first cell to fifth cell of first row (you can adjust row or cell range by passing particular parameters in CellRangeAddress). //Created new Workbook var hwb = new NPOI.HSSF.UserModel. HSSFWorkbook (); //Create worksheet with name. var sheet = hwb.CreateSheet( "new sheet" ); //Create row and cell. var row = sheet.CreateRow(0); var cell = row.CreateCell(0); ; //Set text inside cell cell.SetCellValue( "This is Merged cell" ); cell.CellStyle.WrapText = true ; //define cell range address // parameters: -> first row to last and first cell to last cell var cra = new NPOI.SS.Util. CellRangeAddress (0, 0, 0, 4); //Add merged region to sheet. sheet.AddMergedRegion(cra); Hope this solution helps you J

How to set Swagger as the default start page for API hosted on the Azure web app?

I created an Asp.Net Core 2.x Web API and configured Swagger on it, below is the code added in Configure method under Startup.cs file, for full swagger configuration, check here //Add swagger configuration app.UseSwagger(); app.UseSwaggerUI(c => {     c.SwaggerEndpoint( "../swagger/v1/swagger.json" , "Test API V1" ); }); On my local machine when I run the API it is automatically redirected to the Swagger page. However, when I hosted this API as an Azure web app it is not redirecting directly to the Swagger and to access the swagger, I had to append /swagger in the URL, for example, https://testapi.azurewebsites.net/swagger/ Solution: Set RoutePrefix to string.Empty under app.UseSwaggerUI like below: app.UseSwaggerUI(c => {     c.SwaggerEndpoint( "../swagger/v1/swagger.json" , "Test API V1" );      c.RoutePrefix = string .Empty; // Set Swagger UI at apps root }); And that’s it, now when you b...