SQL Prompt--sql Smart Tip Plugin

Source: Internet
Author: User

Database is in the development of the project will certainly be used, C # projects with the most is Microsoft's own SQL Server. Admittedly, Microsoft's Visual Studio development platform is very useful, very intuitive embodiment is smart tips. Hit a few characters, the relevant information is listed, very convenient. If you change to write a piece of code in Notepad, no one will want it, because people are used to smart hints. However, Microsoft did not do well in the IDE of the database, until SQL2008 to join the not very powerful smart hints. At present, the general use of the SQL2005, writing code when only a field knock out, this taste can not be affected. Even if you want to be lazy, you can only copy fields from the previous code. Fortunately, there is a better lazy way to install SQL Prompt. A lot of nonsense, the following introduction of this little thing, to ensure that you are currently knocking on the field you will love.

installation process

1. Exit the IDE for VS and SQL.

2, open the compressed package, run SQL Prompt 3.msi, follow the prompts to complete the installation.

3, the program will automatically run after installation, in order to complete the crack, you need to find the icon in the system tray, right click, choose to exit.

4. Run the Patch.exe in the compressed package and wait 10 seconds until the button below becomes "OK". Cracking the package does not require selecting the program's installation path. Tip: A lot of anti-virus software will be cracked packet as a trojan, this step need to first disable antivirus software.

5. Find Red gate->sql Prompt 3->sql Prompt Query Analyzer Integration in the Start menu and click Run.

After the plugin is installed, a "SQL Prompt" menu item is added to the main menu of the IDE for VS and SQL to control and configure the plug-in.

The use of this plugin is described below.

1. Refresh the cache

Open SQL 2005, and the plugin will run automatically. The plug-in principle is to cache the tables, views, and stored procedures in the database, so the first time you open the Query Analyzer, the plugin will have a process to load the cache. Also, it is important to note that the plugin does not actively update the cache, and if the objects in the database change and you need to refresh the cache manually, you can press CTRL+SHIFT+D or find the SQL Prompt->refresh cache in the main menu.

2. Smart Tips

When writing code in Query Analyzer, the plug-in is as smart as vs. Not only does it list the names of related objects, but it also lists the object's creation code. Such as.

Once the input is complete, move the mouse over the name of the database object and the plugin will give you a hint.

Click on the Prompt tab to open the definition code for the database object.

Not only tables, views, and stored procedures, but also prompts to move the mouse over fields and parameters.

3. Automatic insertion

Of course, these functions are not very powerful if you simply list the candidates, or give the definition and type of the object. The automatic insertion saves a lot of time knocking the code.

For example, after entering "select * from table name", pressing the TAB key will automatically add "as Alias". After the cursor is positioned to "*", a message "press TAB to expand Wildcard" appears.

What do you mean by this sentence? Press the TAB key to see the effect:

The fields of this table are automatically listed. When there are so many fields in the table, it can be very helpful. How, begin to realize its strong.

Proceed below, enter "INSERT into table name", press TAB key to automatically implement the INSERT statement. The effect is as follows:

When you associate multiple tables, you will also be prompted, depending on the field name or type (configurable).

4. Code Snippet

If you're a lazy person, you know that there's a code snippet in vs. For example, if you enter for, pressing the TAB key will show the following code:

SQL prompt certainly does not miss out on such a powerful feature, after it has been installed, there are many built-in code snippets. For example, to enter the SSF, the plugin will give the following hint:

Pressing the TAB key will replace "SSF" with "SELECT * from". Other commonly used tables are the following:

Abbreviation

Code snippet

Be

BEGIN ... END

Bt

BEGIN TRANSACTION

Df

DELETE from

Fj

Full JOIN

Ii

INSERT into

Ij

INNER JOIN

Lj

Left JOIN

Rj

Right JOIN

Scf

SELECT COUNT (*) from

Ssf

SELECT * FROM

st100

SELECT TOP * FROM

Here are just a few of the commonly used code snippets, many of which you need to see for yourself. "Can SQL prompt customize code snippets?" "If you can immediately think of this problem, it means you have a lazy level." Because you can customize the code snippet in VS, you won't be able to meet these already defined code snippets here. Obviously, SQL prompt is not that rigid, and custom code snippets are required.

In the SQL IDE main menu, locate the SQL Prompt->options and click the menu popup configuration form. Switch to the snippets page and you will see the following interface.

Click the "New" button to start adding custom code snippets. For example, I have defined the data type as a code snippet, such as:

When you need to enter a data type later, enter Dec to press TAB to become decimal (18,2), and enter NVC to press TAB to nvarchar (50). How, more convenient, no longer have to Chi Chi knock a lot of code. Especially for large segments of fixed-format code, such as transactions, cursors, etc., greatly improve the input efficiency.

Here is a special symbol $cursor$, which is used to specify where the cursor stays after the abbreviation is converted to a code snippet, and there are similar symbols in the VS code snippet. It is useful for multiple lines of code snippets, and if not specified, the cursor stops at the end of the code snippet.

5. Configuration

Install a software, many people will be based on their preferences to configure. SQL prompt also has a lot of configuration items, such as case, shortcut keys, whether to add aliases automatically, prompt display time, and so on. Here is not detailed introduction, everyone according to their own habits to configure it.

Finally, if you have any useful software, or very good working methods, can let everyone lazy together, welcome to share out Oh!

SQL Prompt--sql Smart Tip Plugin

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.