SQL SERVER – Auto Complete and Format T-SQL Code

Some people call it laziness, some will call it efficiency, some think it is the right thing to do. At any rate, tools are meant to make a job easier, and I like to use various tools. If we consider the history of the world, if we all wanted to keep traditional practices, we would have never invented the wheel.  But as time progressed, people wanted convenience and efficiency, which then led to laziness. Wanting a more efficient way to do something is not inherently lazy.  That’s how I see any efficiency tools for auto complete.

A few days ago I found Devart SQL Complete.  It took less than a minute to install, and after installation it just worked without needing any tweaking.  Once I started using it I was impressed with how fast it formats SQL code – you can write down any terms or even copy and paste.  You can start typing right away, and it will complete keywords, object names, and fragmentations. It completes statement expressions.  How many times do we write insert, update, delete?  Take this example: to alter a stored procedure name, we don’t remember the code written in it, you have to write it over again, or go back to SQL Server Studio Manager to create and alter which is very difficult.  With SQL Complete , you can write “alter stored procedure,” and it will finish it for you, and you can modify as needed.

I love to write code, and I love well-written code.  When I am working with clients, and I find people whose code have not been written properly, I feel a little uncomfortable.  It is difficult to deal with code that is in the wrong case, with no line breaks, no white spaces, improper indents, and no text wrapping.  The worst thing to encounter is code that goes all the way to the right side, and you have to scroll a million times because there are no breaks or indents.  SQL Complete will take care of this for you – if a developer is too lazy for proper formatting, then Devart’s SQL formatter tool will make them better, not lazier.

SQL Management Studio gives information about your code when you hover your mouse over it, however SQL Complete goes further in it, going into the work table, and the current rate idea, too. It gives you more information about the parameters; and last but not least, it will just take you to the help file of code navigation.  It will open object explorer in a document viewer.  You can start going through the various properties of your code – a very important thing to do.

Here are are interesting Intellisense examples:

1) We are often very lazy to expand *however, when we are using SQL Complete we can just mouse over the * and it will give us all the the column names and we can select the appropriate columns.

2) We can put the cursor after * and it will give us option to expand it to all the column names by pressing the Tab key.

3) Here is one more Intellisense feature I really liked it. I always alias my tables and I always select the alias with special logic. When I was using SQL Complete I selected just a tablename (without schema name) and…(just like below image)

… and it autocompleted the schema and alias name (the way I needed it).

I believe using SQL Complete we can work faster.  It supports all versions of SQL Server, and works SQL formatting.  Many businesses perform code review and have code standards, so why not use an efficiency tool on everyone’s computer and make sure the code is written correctly from the first time?  If you’re interested in this tool, there are free editions available.  If you like it, you can buy it.  I bought it because it works.  I love it, and I want to hear all your opinions on it, too.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Devart, SQL Utility
Previous Post
SQLAuthority News – First SQL Bangalore Event Report – Nov 24, 2012 – SQL Server User Group Bangalore
Next Post
SQL SERVER – Select the Most Optimal Backup Methods for Server

Related Posts

11 Comments. Leave new

  • Hi,

    We are running a finance company in Bihar with over 54 branches…our software vendor is Orange technologies from Kolkata. The software is too slow during business hours. Please guide us, on how to increase the space so that processing time can be shortened at branches.
    [email removed]
    regards,
    Chetan.

    Reply
  • Hi Pinal Sir,
    Just now installed SQL Complete. Really its awesome !!.I am pretty much impressed with this tool. It saves a lot of time of developers. Rather concentrating on formatting and all we can concentrate on business logic. Thank you so much sir.

    Reply
  • tool is awesome, and looks like same as visual studio intelligence,saves lot of time with free version

    Reply
  • Found out that it convers ‘Database_1.dbo.Contacts’ to ‘database_1.dbo.contacts’.. I tried to find out if I can revoke this change, but unable to do that..

    For my company, standards must be followed. other than that, its good.

    Reply
    • We would like to let you know that the new build 4.0.54 of dbForge SQL Complete where this issue is fixed, has been released and is available for downloading:

      Reply
  • Cool Mind is correct, this is a crap feature they’ve added in the latest version., STAY AWAY. In the latest version you must have everything is upper case or lower case, it no longer gives the option for Pascal/Camel, it is now a paid for option!!!

    Reply
  • The new option ‘Do not change’ for Identifier Case will be added in the next build of dbForge SQL Complete that should be released shortly.

    Currently, we suggest you to install the Trial version of the Standard Edition of dbForge SQL Complete, but not the Express one, and make the following changes:

    1. Select ‘SQL Complete -> Options’ from the main menu. The ‘Options’ window opens.
    2. Navigate to the ‘Formatting -> Profiles’ branch.
    3. Select a profile.
    4. Click ‘Edit Profile…’. The ‘Edit Profile’ window opens.
    5. Select the ‘Text Case -> Identifier Case’ branch.
    6. Select the ‘As in the database’ radio-button.

    Sorry for the inconvenience.

    Reply
    • Carlos Caleco
      March 18, 2016 6:24 pm

      Hi Pinal or Devart Team,
      Do you know how can I configure SQL Complete to ident text after in clause?
      Ex: WHERE xxx IN (1,
      2,
      3,
      4,
      5)
      to WHERE xxx IN (1, 2, 3, 4, 5)

      Thank you for your help

      Reply
  • I like this tool very much, it is easy and convenient.

    Reply
  • Carlos Caleco
    March 17, 2016 10:11 pm

    Hi Pinal or Devart Team,
    Do you know how can I configure SQL Complete to ident text after in clause?
    Ex: WHERE xxx IN (1,
    2,
    3,
    4,
    5)
    to WHERE xxx IN (1, 2, 3, 4, 5)

    Thank you for your help

    Reply

Leave a ReplyCancel reply

Exit mobile version