Skip to content

Commit 4a9c89d

Browse files
authored
Merge pull request #6936 from MicrosoftDocs/master
8/23 PM Publish
2 parents e8e013b + aef6490 commit 4a9c89d

5 files changed

Lines changed: 42 additions & 60 deletions

File tree

docs/2014/relational-databases/indexes/columnstore-indexes-described.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.author: mikeray
2121
manager: craigg
2222
---
2323
# Columnstore Indexes Described
24-
The [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)]*in-memory columnstore index* stores and manages data by using column-based data storage and column-based query processing. Columnstore indexes work well for data warehousing workloads that primarily perform bulk loads and read-only queries. Use the columnstore index to achieve up to **10x query performance** gains over traditional row-oriented storage, and up to **7x data compression** over the uncompressed data size.
24+
The [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] *in-memory columnstore index* stores and manages data by using column-based data storage and column-based query processing. Columnstore indexes work well for data warehousing workloads that primarily perform bulk loads and read-only queries. Use the columnstore index to achieve up to **10x query performance** gains over traditional row-oriented storage, and up to **7x data compression** over the uncompressed data size.
2525

2626
> [!NOTE]
2727
> We view the clustered columnstore index as the standard for storing large data warehousing fact tables, and expect it will be used in most data warehousing scenarios. Since the clustered columnstore index is updateable, your workload can perform a large number of insert, update, and delete operations.

docs/relational-databases/import-export/xml-format-files-sql-server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "XML Format Files (SQL Server) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "03/14/2017"
@@ -531,7 +531,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
531531
<RECORD>
532532
<FIELD ID="1" xsi:type="CharFixed" LENGTH="10"/>
533533
<FIELD ID="2" xsi:type="CharFixed" LENGTH="6"/>
534-
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\r\n"
534+
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\r\n"/>
535535
</RECORD>
536536
<ROW>
537537
<COLUMN SOURCE="1" NAME="C1" xsi:type="SQLINT" />

docs/relational-databases/system-stored-procedures/sp-describe-undeclared-parameters-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "sp_describe_undeclared_parameters (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/27/2018"
4+
ms.date: "08/15/2018"
55
ms.prod: sql
66
ms.prod_service: "database-engine, sql-database"
77
ms.component: "system-stored-procedures"
@@ -100,7 +100,7 @@ sp_describe_undeclared_parameters
100100

101101
- If the input [!INCLUDE[tsql](../../includes/tsql-md.md)] batch declares a local variable of the same name as a parameter declared in \@params.
102102

103-
- If the statement creates any temporary tables.
103+
- If the statement references temporary tables.
104104

105105
If \@tsql has no parameters, other than those declared in \@params, the procedure returns an empty result set.
106106

docs/relational-databases/tutorial-signing-stored-procedures-with-a-certificate.md

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Tutorial: Signing Stored Procedures with a Certificate | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/14/2017"
4+
ms.date: "08/23/2018"
55
ms.prod: sql
66
ms.prod_service: "database-engine"
77
ms.component: "tutorial"
@@ -17,44 +17,39 @@ helpviewer_keywords:
1717
- "signing stored procedures tutorial [SQL Server]"
1818
ms.assetid: a4b0f23b-bdc8-425f-b0b9-e0621894f47e
1919
caps.latest.revision: 11
20-
author: "rothja"
21-
ms.author: "jroth"
20+
author: "MashaMSFT"
21+
ms.author: "mathoma"
2222
manager: craigg
2323
---
2424
# Tutorial: Signing Stored Procedures with a Certificate
2525
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
2626
This tutorial illustrates signing stored procedures using a certificate generated by [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)].
2727

2828
> [!NOTE]
29-
> To run the code in this tutorial you must have both Mixed Mode security configured and the [!INCLUDE[ssSampleDBobject](../includes/sssampledbobject-md.md)] database installed. Scenario
29+
> To run the code in this tutorial you must have both Mixed Mode security configured and the AdventureWorks2017 database installed.
3030
3131
Signing stored procedures using a certificate is useful when you want to require permissions on the stored procedure but you do not want to explicitly grant a user those rights. Although you can accomplish this task in other ways, such as using the EXECUTE AS statement, using a certificate allows you to use a trace to find the original caller of the stored procedure. This provides a high level of auditing, especially during security or Data Definition Language (DDL) operations.
3232

33-
You can create a certificate in the master database to allow server-level permissions, or you can create a certificate in any user databases to allow database-level permissions. In this scenario, a user with no rights to base tables must access a stored procedure in the [!INCLUDE[ssSampleDBobject](../includes/sssampledbobject-md.md)] database, and you want to audit the object access trail. Rather than using other ownership chain methods, you will create a server and database user account with no rights to the base objects, and a database user account with rights to a table and a stored procedure. Both the stored procedure and the second database user account will be secured with a certificate. The second database account will have access to all objects, and grant access to the stored procedure to the first database user account.
33+
You can create a certificate in the master database to allow server-level permissions, or you can create a certificate in any user databases to allow database-level permissions. In this scenario, a user with no rights to base tables must access a stored procedure in the AdventureWorks2017 database, and you want to audit the object access trail. Rather than using other ownership chain methods, you will create a server and database user account with no rights to the base objects, and a database user account with rights to a table and a stored procedure. Both the stored procedure and the second database user account will be secured with a certificate. The second database account will have access to all objects, and grant access to the stored procedure to the first database user account.
3434

3535
In this scenario you will first create a database certificate, a stored procedure, and a user, and then you will test the process following these steps:
3636

37-
1. Configure the environment.
38-
39-
2. Create a certificate.
40-
41-
3. Create and sign a stored procedure using the certificate.
42-
43-
4. Create a certificate account using the certificate.
44-
45-
5. Grant the certificate account database rights.
46-
47-
6. Display the access context.
48-
49-
7. Reset the environment.
50-
5137
Each code block in this example is explained in line. To copy the complete example, see [Complete Example](#CompleteExample) at the end of this tutorial.
38+
39+
## Prerequisites
40+
To complete this tutorial, you need SQL Server Management Studio, access to a server that's running SQL Server, and an AdventureWorks database.
41+
42+
- Install [SQL Server Management Studio](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms).
43+
- Install [SQL Server 2017 Developer Edition](https://www.microsoft.com/sql-server/sql-server-downloads).
44+
- Download [AdventureWorks2017 sample databases](https://docs.microsoft.com/sql/samples/adventureworks-install-configure).
45+
46+
Instructions for restoring databases in SSMS are here: [Restore a database](https://docs.microsoft.com/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms).
5247

5348
## 1. Configure the Environment
54-
To set the initial context of the example, in [!INCLUDE[ssManStudioFull](../includes/ssmanstudiofull-md.md)] open a new Query and run the following code to open the [!INCLUDE[ssSampleDBobject](../includes/sssampledbobject-md.md)] database. This code changes the database context to `AdventureWorks2012` and creates a new server login and database user account (`TestCreditRatingUser`), using a password.
49+
To set the initial context of the example, in [!INCLUDE[ssManStudioFull](../includes/ssmanstudiofull-md.md)] open a new Query and run the following code to open the Adventureworks2017 database. This code changes the database context to `AdventureWorks2012` and creates a new server login and database user account (`TestCreditRatingUser`), using a password.
5550

56-
```
57-
USE AdventureWorks2012;
51+
```sql
52+
USE AdventureWorks2017;
5853
GO
5954
-- Set up a login for the test user
6055
CREATE LOGIN TestCreditRatingUser
@@ -72,18 +67,18 @@ You can create certificates in the server using the master database as the conte
7267

7368
Run this code to create a database certificate and secure it using a password.
7469

75-
```
70+
```sql
7671
CREATE CERTIFICATE TestCreditRatingCer
7772
ENCRYPTION BY PASSWORD = 'pGFD4bb925DGvbd2439587y'
7873
WITH SUBJECT = 'Credit Rating Records Access',
79-
EXPIRY_DATE = '12/05/2014';
74+
EXPIRY_DATE = '12/05/2020'; -- Error 3701 will occur if this date is not in the future
8075
GO
8176
```
8277

8378
## 3. Create and Sign a Stored Procedure Using the Certificate
8479
Use the following code to create a stored procedure that selects data from the `Vendor` table in the `Purchasing` database schema, restricting access to only the companies with a credit rating of 1. Note that the first section of the stored procedure displays the context of the user account running the stored procedure, which is to demonstrate the concepts only. It is not required to satisfy the requirements.
8580

86-
```
81+
```sql
8782
CREATE PROCEDURE TestCreditRatingSP
8883
AS
8984
BEGIN
@@ -105,7 +100,7 @@ GO
105100

106101
Run this code to sign the stored procedure with the database certificate, using a password.
107102

108-
```
103+
```sql
109104
ADD SIGNATURE TO TestCreditRatingSP
110105
BY CERTIFICATE TestCreditRatingCer
111106
WITH PASSWORD = 'pGFD4bb925DGvbd2439587y';
@@ -119,8 +114,8 @@ For more information on signing stored procedures, see [ADD SIGNATURE &#40;Trans
119114
## 4. Create a Certificate Account Using the Certificate
120115
Run this code to create a database user (`TestCreditRatingcertificateAccount`) from the certificate. This account has no server login, and will ultimately control access to the underlying tables.
121116

122-
```
123-
USE AdventureWorks2012;
117+
```sql
118+
USE AdventureWorks2017;
124119
GO
125120
CREATE USER TestCreditRatingcertificateAccount
126121
FROM CERTIFICATE TestCreditRatingCer;
@@ -130,7 +125,7 @@ GO
130125
## 5. Grant the Certificate Account Database Rights
131126
Run this code to grant `TestCreditRatingcertificateAccount` rights to the base table and the stored procedure.
132127

133-
```
128+
```sql
134129
GRANT SELECT
135130
ON Purchasing.Vendor
136131
TO TestCreditRatingcertificateAccount;
@@ -147,7 +142,7 @@ For more information on granting permissions to objects, see [GRANT &#40;Transac
147142
## 6. Display the Access Context
148143
To display the rights associated with the stored procedure access, run the following code to grant the rights to run the stored procedure to the `TestCreditRatingUser` user.
149144

150-
```
145+
```sql
151146
GRANT EXECUTE
152147
ON TestCreditRatingSP
153148
TO TestCreditRatingUser;
@@ -156,14 +151,14 @@ GO
156151

157152
Next, run the following code to run the stored procedure as the dbo login you used on the server. Observe the output of the user context information. It will show the dbo account as the context with its own rights and not through a group membership.
158153

159-
```
154+
```sql
160155
EXECUTE TestCreditRatingSP;
161156
GO
162157
```
163158

164159
Run the following code to use the `EXECUTE AS` statement to become the `TestCreditRatingUser` account and run the stored procedure. This time you will see the user context is set to the USER MAPPED TO CERTIFICATE context.
165160

166-
```
161+
```sql
167162
EXECUTE AS LOGIN = 'TestCreditRatingUser';
168163
GO
169164
EXECUTE TestCreditRatingSP;
@@ -178,7 +173,7 @@ This shows you the auditing available because you signed the stored procedure.
178173
## 7. Reset the Environment
179174
The following code uses the `REVERT` statement to return the context of the current account to dbo, and resets the environment.
180175

181-
```
176+
```sql
182177
REVERT;
183178
GO
184179
DROP PROCEDURE TestCreditRatingSP;
@@ -198,9 +193,9 @@ For more information about the REVERT statement, see [REVERT &#40;Transact-SQL&#
198193
## <a name="CompleteExample"></a>Complete Example
199194
This section displays the complete example code.
200195

201-
```
202-
/* Step 1 - Open the AdventureWorks2012 database */
203-
USE AdventureWorks2012;
196+
```sql
197+
/* Step 1 - Open the AdventureWorks2017 database */
198+
USE AdventureWorks2017;
204199
GO
205200
-- Set up a login for the test user
206201
CREATE LOGIN TestCreditRatingUser
@@ -214,7 +209,7 @@ GO
214209
CREATE CERTIFICATE TestCreditRatingCer
215210
ENCRYPTION BY PASSWORD = 'pGFD4bb925DGvbd2439587y'
216211
WITH SUBJECT = 'Credit Rating Records Access',
217-
EXPIRY_DATE = '12/05/2014';
212+
EXPIRY_DATE = '12/05/2020'; -- Error 3701 will occur if this date is not in the future
218213
GO
219214

220215
/* Step 3 - Create a stored procedure and

docs/t-sql/statements/alter-database-transact-sql.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "ALTER DATABASE (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "08/07/2018"
@@ -44,23 +44,10 @@ In the following row, click whichever product name you are interested in. The cl
4444

4545
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=sqlallproducts-allversions"
4646

47-
> [!div class="mx-tdCol2BreakAll"]
48-
> <table>
49-
> <tr>
50-
> <th> &nbsp; </th>
51-
> <th> &nbsp; </th>
52-
> <th> &nbsp; </th>
53-
> <th> &nbsp; </th>
54-
> <th> &nbsp; </th>
55-
> </tr>
56-
> <tr>
57-
> <th><strong><em>* SQL Server *<br />&nbsp;</em></strong></th>
58-
> <th><a href="alter-database-transact-sql.md?view=azuresqldb-current">SQL Database<br />logical server</a></th>
59-
> <th><a href="alter-database-transact-sql.md?view=azuresqldb-mi-current">SQL Database<br />Managed Instance</a></th>
60-
> <th><a href="alter-database-transact-sql.md?view=azure-sqldw-latest">SQL Data<br />Warehouse</a></th>
61-
> <th><a href="alter-database-transact-sql.md?view=aps-pdw-2016">SQL Parallel<br />Data Warehouse</a></th>
62-
> </tr>
63-
> </table>
47+
> [!div class="mx-tdCol2BreakAll"]
48+
> ||||||
49+
> |---|---|---|---|---|
50+
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />logical server](alter-database-transact-sql.md?view=azuresqldb-current)|[SQL Database<br />Managed Instance](alter-database-transact-sql.md?view=azuresqldb-mi-current)|[SQL Data<br />Warehouse](alter-database-transact-sql.md?view=azure-sqldw-latest)|[SQL Parallel<br />Data Warehouse](alter-database-transact-sql.md?view=aps-pdw-2016)|
6451
6552
&nbsp;
6653

0 commit comments

Comments
 (0)