Redgate Sql Prompt

Get the most out of SQL Prompt (technical how-to articles) Redgate's Product Learning articles for SQL Prompt demonstrate practical uses for all of its main features. Use the ' Topics ' list, on the right, to navigate to the SQL Prompt topics of interest. You can also filter by the level (or type) of article. Hi Redgate Team, SQL Prompt will raise an error when formatting ALTER SERVER CONFIGURATION SET MEMORYOPTIMIZED TEMPDBMETADATA=ON;GO Thanks for fixing! SQL Prompt and SSMS 18.5. Posted on April 8, 2020 by way0utwest. I downloaded SSMS 18.5, as there were a lot of fixes in here and thought this was a good upgrade to try. I’d heard reports of major changes in the VS shell causing issues with various add-ins, including Redgate tools, so I decided to verify things. Especially for SQL Prompt. Unfortunately SQL Prompt 9 does not work with SSMS 18.5 or later. This is due to a breaking change within SSMS which was addressed in a later version of SQL Prompt 10. In order to use SSMS 18.5 or later you will need to purchase a SQL Prompt 10 license. Otherwise you will need to downgrade to SSMS 18.4 to continue using SQL Prompt 9.

SQL Prompt stores information about the structure of databases in cache files. Using cache files speeds up performance when SQL Prompt retrieves information about a database.

SQL Prompt creates a cache file for each database that you use. The cache files are encrypted and stored in your local settings on your computer; SQL Prompt can read only the cache files that were created by your Windows® user.

Note that SQL Prompt does not create cache files for databases you have chosen to ignore.

Sql

Redgate Sql Prompt Download

To manage the cache files, on the SQL Prompt menu, click Cache Management.

Refreshing cache files

If the structure of a databases has been modified, for example if a table has been added to the database, you can refresh the cache files so that the changes are shown in the candidate list. SQL Prompt updates the cache files ready for you to use immediately.

To refresh the cache file for the database you are using in your query editor, on the SQL Prompt menu, click Refresh Cache, or press CTRL+SHIFT+D.

You can set SQL Prompt so that it refreshes cache files whenever you connect to a database or open a new query editor session. You do this by selecting the check box on the Cache Management dialog box.

To refresh selected cache files, on the Cache Management dialog box, select the databases for which you want to update the cache, and then click Refresh.

To refresh all cache files, on the Cache Management dialog box, click Refresh All. The Caching Progress bar shows the progress of the refresh. This process may be time-consuming if you have many databases cached, or if you have large databases cached. However, you can close the Cache Management dialog box and continue working while the cache is refreshing.

Note that if a database is being restored or it is offline, you cannot refresh its cache file.

Deleting cache files

Redgate sql prompt not working

You may want to delete cache files, for example to create disk space. If you delete the cache file for a database, SQL Prompt creates a new cache file the next time you use the databases in your query editor.

To delete individual cache files, on the Cache Management dialog box, select the databases for which you want to delete the cache, and then click Delete.

To delete all the cache files, on the Cache Management dialog box, click Delete All.

Redgate Sql Prompt Pro

Maximum number of databases to hold in memory

You can change the number of databases to be cached. For example, you may want to increase the number if you are using cross-database support and you regularly query a number of different databases.

However, note that caching databases increases memory usage, so if your memory usage is high you may want reduce this number.

The minimum value for this option is 3.

© Red Gate Software Ltd 2007. All Rights Reserved.

Published 12 April 2021

Formatting

SQL Prompt ships with a formatter that can be run from the command line to format a collection of SQL files.

Where to find the command line formatter

The command line formatter can be found inside a zip file called FormatCommandLine.zip in the SQL Prompt installation directory (usually C:Program Files (x86)Red GateSQL Prompt 10).

To run the command line formatter, extract the zip file to a directory and run SqlPrompt.Format.CommandLine.exe with the desired arguments.

Adding the command line formatter to your PATH variable

To make the command line formatter accessible within a command prompt (e.g. Windows Terminal) without specifying its full path, you can add the formatter to your PATH environment variable:

  1. Search path in the start menu, and click on Edit environment variables for your account:
  2. Click on Environment Variables, then double click on the entry titled Path. Then press New and add the path of the folder you have extracted the command line formatter to:
  3. You should then be able to use SqlPrompt.Format.CommandLine.exe directly within your command prompt window.


Running the command line formatter

Redgate sql promptRedgate sql prompt free

To run the SQL Prompt formatter from the command line, run SqlPrompt.Format.CommandLine.exe with the relevant arguments:

OptionAliasDescription
--i-agree-to-the-eula
Confirms that you agree to the End User Licence Agreement when running the command line formatter. This argument is required.
--path-pThe file or directory to format. This argument is required.
--create-backups-b

Create backups of formatted files.

The original SQL file will be backed up to a file with a .bak extension, located next to the original file.

--style-s

The name of a Redgate formatting style, or the file path of a formatting style file (.json).

If no style is specified, laying out of SQL will be skipped.

The name of the Redgate formatting style can be one of:

  • Default
  • Collapsed
  • Commas before
  • Indented
  • Right aligned
--apply-casing-acApply casing options when formatting. The options are defined in the Global → Casing section of a formatting style.
--prefix-unicode-nPrefix N to unicode literal string variable assignments.
--insert-semicolons-isInsert semicolons.
--enclose-identifiers-e

Add/remove square brackets. Possible values:

  • WithBrackets - add brackets to all identifiers
  • WithoutBrackets - remove unnecessary brackets
--table-alias-style-ta

Add/remove AS keyword on alias definitions for tables and views. Possible values:

  • AddAs - add AS keyword
  • RemoveAs - remove AS keyword
--column-alias-style-ca

Apply column alias style. Possible values:

  • AsWithoutString (e.g. column AS alias)
  • AsWithString (e.g. column AS 'alias')
  • EqualsWithoutString (e.g. alias = column)
  • EqualsWithString (e.g. alias = 'column')
  • NoAsWithoutString (e.g. column alias)
  • NoAsWithString (e.g. column 'alias')
--version
Shows the current version number of the command line formatter.
--help-h, -?Shows the command line help that lists the available options.

Redgate Sql Prompt Azure

Omitting any argument will cause that formatting action to be skipped.


When running, the command line formatter will summarize the options that it is using to apply the format:


As it processes each SQL file to be formatter, the command line formatter will show progress and any errors encountered:



Redgate Sql Prompt License

Didn't find what you were looking for?