Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

SQL Server Management Studio 17.x Important Features

$
0
0

By: Rajendra Gupta || Related Tips:More > SQL Server Management Studio

Problem

SQL Server Management Studio is now a standalone installation and is not part of the SQL Server setup. In my previous tips, New Features in SQL Server Management Studio v17 and SQL Server Management Studio Import Wizard Improvements , we explored some of the important features of SQL Server Management Studio 17.x version. In this tip, we will go through some other exciting features.

Solution

SSMS 17.x is the latest generation of SQL Server Management Studio and provides support for SQL Server 2017 and older versions. The idea behind the separate installation file of SSMS is to keep it separate from the server component and Microsoft is providing regular release versions with new features and enhancements over previous SSMS versions. SSMS 17 is common for all versions and editions of SQL Server and does not require any license to use it. The below table shows SSMS 17.x release, build information.

Release Number Build Number Release Date 17.8.1 14.0.17277.0 June 26, 2018 17.7 14.0.17254.0 May 09, 2018 17.6 14.0.17230.0 March 20, 2018 17.5 14.0.17224.0 Feb 16,2018 17.4 14.0.17213.0 December 7,2017 17.3 14.0.17199.0 October 10,2017 17.2 14.0.17177.0 August 8,2017 17.1 14.0.17119.0 May 24,2017 17.0 14.0.17099.0 25 April 2017

We can view SSMS properties from Help > About. Below the SQL Server Management Studio versions is 17.8.1.


SQL Server Management Studio 17.x Important Features

In this tip, we will be exploring these features of SQL Server Management Studio 17.x:

Upgrade SSMS to the latest version SQL Server AUTOGROW_ALL_FILES Option The Built-in Performance Dashboard

Let us explore these one by one.

1. Upgrade SSMS to the latest version

If we want to install SSMS 17.x latest version, we have two options:

For a new installation, we need to download SSMS from the first link Download SQL Server Management Studio 17.8.1 and install it. If we want to upgrade SSMS 17.8.1 from the previous 17.x version, we do not need to install the complete SSMS set up, instead, we can just use the incremental upgrade package. For this, use the link Download SQL Server Management Studio 17.8.1 upgrade package (Upgrades 17.x to 17.8.1)
SQL Server Management Studio 17.x Important Features

Note:While upgrading SSMS, close SSMS if it is running or you will get this error message.


SQL Server Management Studio 17.x Important Features
2. SQL Server AUTOGROW_ALL_FILES Option

SQL Server 2016 provided an option to control auto-growth of the database files within the same filegroup at the database level. In SQL Server 2016, we could do it using the ALTER DATABASE option AUTOGROW_ALL_FILE. You can go through the tip Expand All SQL Server Database Files Simultaneously .

If we go to the database properties by right clicking on the database and then click on Filegroups, in previous SSMS versions other than 17.8.1 we see the following:


SQL Server Management Studio 17.x Important Features

While if we look at the same properties in SSMS 17.8.1, we get the below options. As we can see, we get a new option with checkboxes for 'Autogrow All Files' against each filegroup row.


SQL Server Management Studio 17.x Important Features

In SSMS 17.8.1 version, if we want to enable the 'Autogrow All Files', just put a check against the filegroup name. For example, let's enable this option for USERDATA filegroup by putting a checkbox against the USERDATA filegroup as shown below.


SQL Server Management Studio 17.x Important Features

If the database is in use, we get the below error message. So, you need to first close database connections before applying this setting.


SQL Server Management Studio 17.x Important Features

We can script out this option using Script > Script Actions to New Query Window.


SQL Server Management Studio 17.x Important Features

It generates the below script:


SQL Server Management Studio 17.x Important Features
USE [WideWorldImporters]
GO
declare @autogrow bit
SELECT @autogrow=convert(bit, is_autogrow_all_files) FROM sys.filegroups WHERE name=N'USERDATA'
if(@autogrow=0)
ALTER DATABASE [WideWorldImporters] MODIFY FILEGROUP [USERDATA] AUTOGROW_ALL_FILES
GO

Note: The current SSMS 17.8.1 version generates two scripts - one script with a USE statement and the second script with a USE master statement. The script with USE master is generated in error and should be discarded. Run the script that contains the USE statement. This should be fixed in the next release.

Now let's look at the AutoGrowthEnable property for all of the filegroups in the database.

AutoGrowthEnable=1 shows 'Autogrow All Files' is enabled for the particular filegroup. AutoGrowthEnable=0 shows 'Autogrow All Files' is disabled for the particular filegroup. SELECT
DB_NAME() DatabaseName,
DBF.name AS FileName,
FileG.name as FileGroupName,
FileG.is_autogrow_all_files AutoGrowthEnable
FROM sys.database_files AS DBF
JOIN sys.filegroups AS FileG
ON DBF.data_space_id = FileG.data_space_id
SQL Server Management Studio 17.x Important Features

We can see the 'Autogrow All Files' is enabled for USERDATA filegroup. AutoGrowthEnable is set to 0 for other filegroups, as we did not enable 'Autogrow All Files' for all filegroups.

In the next step, let's view the behavior of enabling 'Autogrow All Files' for a filegroup.

Create a new database 'DemoDatabase' with 3 files in the filegroup Primary as shown below.


SQL Server Management Studio 17.x Important Features

Set 'Autogrow All Files' by putting a check on the checkbox.


Viewing all articles
Browse latest Browse all 3160

Trending Articles