Write a shortcut to a graceful SQL statement

Source: Internet
Author: User
Tags command line execution interface sql split

Engaged in enterprise system development for many years, in the system workflow analysis, it is necessary to analyze the SQL statements, when the system accumulated to a certain scale, the database table involved in the geometric number of growth, so often run into a very long SQL statements, involving more than dozens of tables, when you get such a piece of SQL, Need to analyze the relationship between the tables, the head is a bit big! I Google a bit, did not find the SQL statement to break and indent the tool, but the work is often encountered this SQL, manual to break and indent, but also a mechanical duplication of work, so "lazy" strength up, My own weekend developed a simple auxiliary tool, while sharing to everyone, I have uploaded programs to provide downloads.

Let me briefly introduce the development principles:

(1). In SQL statements: From\select\union\where encounters these keywords will wrap automatically, if nested will automatically indent.

(2). The Select section is very long and will also wrap automatically, and the case section will automatically wrap.

There are 3 files in the program:

  

BreakSQLCmd.exe: Command line tools

BreakSQLUI.exe: Interface tools, as well as command-line tool functions

ObjString.dll: DLLs that contain the actual functionality

And then I'll explain how to use it:

(1). BreakSQLCmd.exe: First to split the SQL copy (Ctrl + C), and then execute the BreakSQLCmd.exe, after the successful execution, the split of the SQL copied to the Clipboard, you are in the Query Analyzer paste (ctrl+z) on the line. The following diagram of the interface:

  

(2). BreakSQLUI.exe: This has the UI, the operation is simple, the interface is as follows:

  

These two EXE execution results are the same, you can choose the way you like!

If you find the problem in use, you can reply to me, and enclose the SQL, I can improve the:)




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.