Sql Server management studio how to auto capitalize

一曲冷凌霜 提交于 2019-12-18 19:32:26

问题


Is there any FREE "build-in" way to capitalize the "keywords" in the SQL 2005/2008 management studio when you write a sql query?

i.e

truncate table x

should be automatically changed to:

TRUNCATE TABLE x

回答1:


the intellisense in the 2008 management studio will do this as well as long as you are connected to a SQL 2008 database.

You can change the case you prefer to upper or lower under Tools / Options / Text Editor / Transact-SQL / IntelliSense




回答2:


There is no built in 'intellisense' in SQL Server 2005 (there is in 2008) but Redgate do an add-in for exactly this and more. It will auto-complete table names, columns, add square brackets, re-format stored procs etc, and it works well:

http://www.red-gate.com/products/SQL_Refactor/index.htm




回答3:


I found a hidden gem for auto upper/lower case formatting and indenting in SSMS that I will forever use. No more "New Query".

Rt-Click table name within Object Explorer | Edit Top 200 Rows | QueryDesigner menu option | Pane | SQL. Write or drop in some ugly, non formatted SQL. QueryDesigner | Verify SQL Syntax will UC reserved words and indent for you.




回答4:


You can use New Query and type in your SQL in lower case in the editor. To change keywords to upper case, select the SQL then press Ctrl + Shift + Q. The Query Designer will open. Highlight the SQL and then right click to bring up menu and choose verify SQL Syntax which will upper case keywords and format the SQL.



来源:https://stackoverflow.com/questions/421847/sql-server-management-studio-how-to-auto-capitalize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!