Home  >  Article  >  Database  >  SQL Prompt Snippet Manager 妙用

SQL Prompt Snippet Manager 妙用

WBOY
WBOYOriginal
2016-06-07 17:37:18872browse

SQL Prompt Snippet Manager 妙用 SQL Prompt有一个很好用的工具叫Snippet Manager,SQL脚本片段管理器。 使用它可以快速的键入一段脚本,如输入ii+Tab,即可变成INSERT INTO 同理,我们可以定义一些简写如 sf SELECT * FROM scf SELECT COUNT(*) FROM 甚至

SQL Prompt Snippet Manager 妙用

SQL Prompt有一个很好用的工具叫Snippet Manager,,SQL脚本片段管理器。

使用它可以快速的键入一段脚本,如输入ii+Tab,即可变成INSERT INTO 

同理,我们可以定义一些简写如

sf  SELECT * FROM 

scf  SELECT COUNT(*) FROM

甚至可以定义大段的片段如游标

csr:

,@p2 VARCHAR(20) DECLARE cursor1 CURSOR LOCAL FORWARD_ONLY READ_ONLY STATIC -- OPEN cursor1 cursor1 cursor1 cursor1 DEALLOCATE cursor1

 

还可以定义业务相关的片段,假设我们有一个枚举值的字段状态比较多,如订单状态,

可以定义一段CASE语句

os:

(CASE Status )

很爽吧,哈哈~

 

 

posted on

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn