You must Sign In to post a response.
  • Category: SQL Server

    Shortcut To Format store procedure

    Hello.

    Is there any shortcut available in sql to format store procedures.
    Its just like in c#.net, Ctrl + K + D.

    It automatically arrange your code in proper format like spacing, tabbing.
  • #763568
    You can get lot of online SQL formaters

    Following is one for the format that you can try.

    http://www.sql-format.com/

    By Nathan
    Direction is important than speed

  • #763571
    Hi Pranjal.

    Nice question, which we didn't come across.
    Even I achieved it by searching many things over google.

    The shortcut you can use to automatically arrange your code in proper format like spacing and tabbing
    in sql server queries is below.

    cntrl+K & \ (both keys should be pressed (k) and backslash(\) with cntrl key combination)

    Try it, It worked for me.

    Sridhar Thota.
    Editor: DNS Forum.

  • #763572
    Hi Pranjal,

    After I read your post I too search the same in Google, but everyone said that there is no built in Shortcut Key for the same, and they suggested to do format using thirdparty tools, refer below link this is the one of the link for the same.
    "dpriver.com/pp/sqlformat.htm"

    If you want to know the shortcuts for SQL Server Management Studio then refer below link, here they provide all the shortcut keys we can able to use in SSMS, in this list also arranging key is not there.

    "technet.microsoft.com/en-us/library/ms174205(v=sql.110).aspx".

    If you found solution then please share to us, that will really helpful to some one those who are looking for the same.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments