如何创建和自定义SQL Server模板

SQL Server Templates are SQL scripts, containing SQL code, frequently used by developers and DBAs in their daily work (e.g. Create Table, Add Column, Drop Column, Create Database, Create Logins etc.):

SQL Server模板是包含开发人员和DBA在日常工作中经常使用SQL脚本SQL脚本(例如,创建表,添加列,删除列,创建数据库,创建登录名等):

SQL Server Templates exists since SQL Server 2000, but the Template Explorer feature SQL Server Templates was introduced in SQL Server 2005. The Template Explorer is a collection of folders that contains the templates based on category (e.g. Database, Backup, Function):

SQL Server模板自SQL Server 2000起就存在,但是SQL Server 2005中引入了模板资源管理器功能SQL Server模板。 模板资源管理器是文件夹的集合,其中包含基于类别的模板(例如,数据库,备份,功能):

In SQL Server 2000 the file extension for SQL templates was .tsql. Since SQL Server 2005 this extension is changed to .sql.

在SQL Server 2000中,SQL模板的文件扩展名为.tsql 。 从SQL Server 2005开始,此扩展名更改为.sql

From SQL Server 2012 the title for the pane that contains SQL Server Templates is changed from the Template Explorer to the Template Browser:

在SQL Server 2012中,包含SQL Server模板的窗格的标题从“ 模板资源管理器”更改为“ 模板浏览器”

By default, the Template Browser pane does not open when SQL Server Management Studio (SSMS) starts. To initiate the Template Browser pane, go to the SSMS main menu, select the View menu and from the list, choose the Template Explorer option or use a combination of keyboard shortcut Ctrl+Alt+T:

默认情况下,启动SQL Server Management Studio(SSMS)时不会打开“ 模板浏览器”窗格。 要启动“ 模板浏览器”窗格,请转到SSMS主菜单,选择“ 查看”菜单,然后从列表中选择“ 模板资源管理器”选项,或使用键盘快捷键Ctrl + Alt + T的组合

This will open the Template Browser pane, by default the Template Browser pane will be shown on the right side of SSMS:

这将打开“ 模板浏览器”窗格,默认情况下,“ 模板浏览器”窗格将显示在SSMS的右侧:

There are three ways to insert SQL template in the query window. Double clicking on it or right click on the SQL template and from the popup menu choose the Open option:

有三种方法可以在查询窗口中插入SQL模板。 双击它或右键单击SQL模板,然后从弹出菜单中选择“ 打开”选项:

Will open SQL template in the new query window:

将在新的查询窗口中打开SQL模板:

And the third is a drag and drop way, will open SQL template in a targeted query window:

第三种是拖放方式,将在目标查询

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值