Pages

Sunday 24 February 2013

How to make your own keyboard shortcut in SSMS?

Today I am going to show you how to create your own keyboard shortcut in SQL server management studio to increase your productivity in development.

We all write SELECT * FROM query very frequently while using SQL so instead write it we can create it as a keyboard shortcut for quick access. Finally it’s depends on you which query you uses most frequently and create shortcut according to it.

STEPS:
1) Open SQL server management studio.
2) Goto Tools à Options.. à Environment à Keyboard.
3) Select your shortcut and enter your query.















How To Use:
Now in Query editor, you need to just type [Table_Name] and select that [Table_Name] then just press shortcut key that you create. That’s it. Enjoy.!!





Saturday 16 February 2013

LEN vs DATALENGTH in SQL Server

LEN() Function: It will return number of character in string that you mention without considering trailing space.

DATALENGTH() Function: It will return number of bytes used to represent the expression. So it will consider space as well in counting.

Please take a look at below image for more idea:




Quick way to put and use your most reusable code.

Today i am going to show one tips of visual studio which i love most. This tips related to quick access of most usable/common code that we used more frequently. We generally waste time to find code across pages and project that we need actually while development so it’s better to save most frequently used code in Toolbox of Visual Studio. You can just Drag your block of code and Drop into toolbox which shown in below figure:











So when you need this code just Drop them into page from toolbox rather then search it out across many pages and projects. You can also rename it if you have many code block in toolbox.

Happy Coding!!