ssms2008 代码自动提示_使用 SSMS 的提示和技巧 - SQL Server Management Studio (SSMS) | Microsoft Docs...

使用 SQL Server Management Studio (SSMS) 的提示和技巧Tips and tricks for using SQL Server Management Studio (SSMS)03/13/2018本文内容本文介绍了一些使用 SQL Server Management StudioSQL Server Management Studio (SSMS) 的提示和技巧...
摘要由CSDN通过智能技术生成

使用 SQL Server Management Studio (SSMS) 的提示和技巧Tips and tricks for using SQL Server Management Studio (SSMS)

03/13/2018

本文内容

本文介绍了一些使用 SQL Server Management StudioSQL Server Management Studio (SSMS) 的提示和技巧。This article gives you some tips and tricks for using SQL Server Management StudioSQL Server Management Studio (SSMS). 本文介绍如何:This article shows you how to:

注释/取消注释 Transact-SQL (T-SQL) 文本Comment/uncomment your Transact-SQL (T-SQL) text

缩进文本Indent your text

在对象资源管理器中筛选对象Filter objects in Object Explorer

访问 SQL ServerSQL Server 错误日志Access your SQL ServerSQL Server error log

查找 SQL ServerSQL Server 实例的名称Find the name of your SQL ServerSQL Server instance

先决条件Prerequisites

若要测试本文提供的步骤,必须有 SQL Server Management StudioSQL Server Management Studio、对 SQL Server 的访问权限,以及 AdventureWorks 数据库。To test out the steps provided in this article, you need SQL Server Management StudioSQL Server Management Studio, access to a SQL server, and an AdventureWorks database.

注释/取消注释 T-SQL 代码Comment/uncomment your T-SQL code

可使用工具栏中的“注释”按钮注释和取消注释部分文本 。You can comment and uncomment portions of your text by using the Comment button on the toolbar. 系统不会执行已注释掉的文本。Text that is commented out is not executed.

打开 SQL Server Management StudioSQL Server Management Studio。Open SQL Server Management StudioSQL Server Management Studio.

连接到 SQL Server。Connect to your SQL server.

打开“新建查询”窗口。Open a New Query window.

将以下 Transact-SQLTransact-SQL 代码粘贴到文本窗口。Paste the following Transact-SQLTransact-SQL code in your text window.

USE master

GO

-- Drop the database if it already exists

IF EXISTS (

SELECT name

FROM sys.databases

WHERE name = N'TutorialDB'

)

DROP DATABASE TutorialDB

GO

CREATE DATABASE TutorialDB

GO

ALTER DATABASE [TutorialDB] SET QUERY_STORE=ON

GO

突出显示文本的“更改数据库”部分,然后选择工具栏中的“注释”按钮 :Highlight the Alter Database portion of the text, and then select the Comment button on the toolbar:

选择“执行”运行取消注释的文本部分 。Select Execute to run the uncommented portion of the text.

突出显示除“更改数据库”命令之外的所有内容,然后选择“注释”按钮 :Highlight everything except for the Alter

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值