- 1
PERCENT_RANK()
PERCENT_RANK() function will returns the percentage value of rank of the values among its group.
PERCENT_RANK() function value always in between 0 and 1.
- 2
PERCENTILE_CONT()
PERCENTILE_CONT() function will takes a parameter, which indicates the offset and it should be between 0 and 1.
Suppose, in a group of values 10,20,30,40,50,60 PERCENTILE_CONT() function will returns any value between 10 and 50. This value will be calculated based on insertion, at given offset position.
- 3
PERCENTILE_DISC()
PERCENTILE_DISC() function will takes a parameter, which indicates the offset and it should be between 0 and 1.
Suppose, in a group of values 10,20,30,40,50,60 PERCENTILE_DISC() function will returns any value between 10 and 50. This value will be calculated based on insertion, at given offset position.
- 4
LAG() AND LEAD()
LAG() will return columns values from its previous rows and LEAD() will return column value from its next rows from the same result set without the use of a self-join.
- 5
CUME_DIST()
Cumulative Distribution is statistical function (i.e probability) .
This function give the probability of outcome. i.e if you throw a dice then the output may be between 1 to 6.
So, possibility fir outcome 1 will be 1/6 = 0.1666
and possibility fir outcome 2 will be 2/6 = 0.3333
- 6
FIRST_VALUE() AND LAST_VALUE()
First value and Last value functions gives a first and last value from its' group respectively.
- 7
CONCAT()
Concat function concat(merge) to string in single as like in .Net. In current version of SQL Server we are doing things as FirstName + ' ' + LastName
- 8
EOMONTH()
EOMONTH() returns the last date of month of given date
- 9
IIF()
IIF() returns either true value or false value based on the specified Boolean expression.
- 10
Choose()
CHOOSE() function will returns the value based on the specified index from the list of values.
- 11
Parse()
Parse() function will parse an value into specified datatype. This function relies on CLR. It will take some performance overhead. Use this function only to convert strings to/from datetime and numeric values.
- 12
TRY_PARSE()
The function is very useful when you are converting value from one datatype to another. If it can not be converted then it will return NULL value rather then exception. But it is based on culture.
- 13
TRY_CONVERT()
The function is very useful when you are converting value from one datatype to another. If it can not be converted then it will return NULL value rather then exception.
- 14
DATETIMEFROMPARTS()
Convert Day, Month, Year etc values to Date.
- 15
TIMEFROMPARTS()
Similar to DATETIMEFROMPARTS()
- 16
DATEFROMPARTS()
Similar to DATETIMEFROMPARTS()
- 17
Format()
Format values based on the culture.
- 18
SEQUENCE()
SEQUENCE is like a new enhancement in Identity.
Identity columns can be used to uniquely identify records in a table. But if we wants to maintain identity columns across multiple tables, or if we need identity column value before insertion of record into table, we can use SEQUENCE.
- 19
EXECUTE : WITH RESULT SETS
When you want to change the data type of resulting column then EXECUTE : WITH RESULT SETS is very useful.
- 20
PAGINATION
In 2008 you are able to achieve pagination using Row_Number()
In Denali (SQL Server 2012)
- 21
RAISERROR
RAISERROR in the format RAISERROR integer 'string' is discontinued.
Rewrite the statement using the current RAISERROR(…) syntax.
- 22
HashBytes
Two new algorithms are added to SQL Server Security portion
"SHA2256" and "SHA2512" as like MD2,MD4,MD5,SHA and SHA1.
- 23
THROW
In denali THROW function is implemented as like .NET. Now everyone can Throw error to calling application.
- 24
Code Snippets
Implemented code snippets feature to increase the usability and speed of coder. You can create your own code snippets and publish to using SSMS tools menu for future use.
To add a new code snippet,
Create the snippet file with .snippet extension(Its advisable to take existing snippet file and modify it)
Go to Tools -> Code Snippets Manager
Select the folder, under which you wants to add code snippet and click on Add button and select the snippet file.
- 25
Multi Monitor Support
Now using SSMS 2012, you can open multiple Query windows at a time. Easily you can drag the query window and can place that query window where ever we want.
- 26
Task List
SQL Devloper often use some external tools to manage their task list, where they will add tasks and will follow the tasks according to the task list.
This Tool is included in SQL Server 2012, where you can add/delete tasks and set the priority of these tasks.
In add task using SSMS,
Go to View -> Task List, which opens task list, where you can add a new task by clicking on Tick mark icon. You can set the priority by clicking on first column in that task.
- 27
Zoom/Magnify
In earlier versions of SQL Server - SSMS there is no facility to zoom their view. To do that you have to change the Font size to cop with the problem.
Now in SQL Server - SSMS 2012, you can get the Zoom in and Zoom out facility.
- 28
Debugging Enhancement
SQL Server SSMS 2012 has improved debugging facility. You can hit the break point based on condition. It is not possible in older version. It is the good features to trace the error point.
i.e You are iteration loop and you have to break at 5th iteration then Conditional break is very useful.
- 29
Surrond With
In built code snippets like Conditional and Iterative operator like IF, WHILE , BEGIN etc. When you are ready with you code and wish that code execute based on condition or iterate it until some condition then you can use Surround With option.
1. Right Click and choose “Surround with”, which shows IF,BEGIN,WHILE options. Or Alternatively press Ctrl+k,Ctrl+s
2. Choose any of the block, that you wants to include in your stored procedure/query
- 30
KeyBoard ShortCuts
If you are very familiar with Visual Studio short cuts and want the same for SSMS 2012 then you can import/export short cuts from Visual Studio to SSMS 2012.
- 31
Multiple ClipBorad
You can copy multiple code/items in Clipboard and use then at any time.
1. From a query window, copy the query content by pressing Ctrl+C
2. Copy another query content by pressing Ctrl+C
3. To access recently copied content, press Ctrl+Shift+V
4. Now to access the first copied content, press Ctrl+Shift+ V two times.
Thanks,
Alpesh