Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit eae8907

Browse files
authored
Merge pull request #5749 from pmasl/patch-212
Update altering-natively-compiled-t-sql-modules.md
2 parents e08e6bf + 255448b commit eae8907

1 file changed

Lines changed: 20 additions & 27 deletions

File tree

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "Altering Natively Compiled T-SQL Modules | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "03/14/2017"
@@ -22,41 +22,34 @@ monikerRange: "= azuresqldb-current || >= sql-server-2016 || = sqlallproducts-al
2222
# Altering Natively Compiled T-SQL Modules
2323
[!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)]
2424

25-
In [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] (and later) and [!INCLUDE[ssSDS](../../includes/sssds-md.md)] you can perform ALTER operations on natively compiled stored procedures and other natively compiled T-SQL modules such as scalar UDFs and triggers using the ALTER statement.
25+
In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] ([!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)]) and [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)], you can perform `ALTER` operations on natively compiled stored procedures and other natively compiled [!INCLUDE[tsql](../../includes/tsql-md.md)] modules such as scalar UDFs and triggers using the `ALTER` statement.
2626

27-
When executing ALTER on a natively compiled T-SQL module, the module is recompiled using a new definition. While recompilation is in progress, the old version of the module continues to be available for execution. Once compilation completes, module executions are drained, and the new version of the module is installed. When you alter a natively compiled T-SQL module, you can modify the following options.
27+
When executing `ALTER` on a natively compiled [!INCLUDE[tsql](../../includes/tsql-md.md)] module, the module is recompiled using a new definition. While recompilation is in progress, the old version of the module continues to be available for execution. Once compilation completes, module executions are drained, and the new version of the module is installed. When you alter a natively compiled [!INCLUDE[tsql](../../includes/tsql-md.md)] module, you can modify the following options.
2828

2929
- Parameters
30-
3130
- EXECUTE AS
32-
3331
- TRANSACTION ISOLATION LEVEL
34-
3532
- LANGUAGE
36-
3733
- DATEFIRST
38-
3934
- DATEFORMAT
40-
4135
- DELAYED_DURABILITY
4236

4337
> [!NOTE]
44-
> Natively compiled T-SQL modules cannot be converted to non-natively compiled modules. Non-natively compiled T-SQL modules cannot be converted to natively compiled modules.
38+
> Natively compiled [!INCLUDE[tsql](../../includes/tsql-md.md)] modules cannot be converted to non-natively compiled modules. Non-natively compiled T-SQL modules cannot be converted to natively compiled modules.
4539
46-
For more information on ALTER PROCEDURE functionality and syntax, see [ALTER PROCEDURE (Transact-SQL)](../../t-sql/statements/alter-procedure-transact-sql.md)
40+
For more information on `ALTER PROCEDURE` functionality and syntax, see [ALTER PROCEDURE (Transact-SQL)](../../t-sql/statements/alter-procedure-transact-sql.md).
4741

48-
You can execute sp_recompile on a natively compiled T-SQL modules, which causes the module to recompile on the next execution.
42+
You can execute [sp_recompile](../../relational-databases/system-stored-procedures/sp-recompile-transact-sql.md) on a natively compiled [!INCLUDE[tsql](../../includes/tsql-md.md)] modules, which causes the module to recompile on the next execution.
4943

5044
## Example
51-
The following example creates a memory-optimized table (T1), and a natively compiled stored procedure (SP1) that selects all the T1 columns. Then, SP1 is altered to remove the EXECUTE AS clause, change the LANGUAGE, and select only one column (C1) from T1.
52-
53-
```
54-
CREATE TABLE [dbo].[T1]
55-
(
56-
[c1] [int] NOT NULL,
57-
[c2] [float] NOT NULL,
58-
CONSTRAINT [PK_T1] PRIMARY KEY NONCLUSTERED ([c1])
59-
)WITH ( MEMORY_OPTIMIZED = ON , DURABILITY = SCHEMA_AND_DATA )
45+
The following example creates a memory-optimized table (T1), and a natively compiled stored procedure (usp_1) that selects all the T1 columns. Then, usp_1 is altered to remove the `EXECUTE AS` clause, change the `LANGUAGE`, and select only one column (C1) from T1.
46+
47+
```sql
48+
CREATE TABLE [dbo].[T1] (
49+
[c1] [int] NOT NULL,
50+
[c2] [float] NOT NULL,
51+
CONSTRAINT [PK_T1] PRIMARY KEY NONCLUSTERED ([c1])
52+
) WITH ( MEMORY_OPTIMIZED = ON , DURABILITY = SCHEMA_AND_DATA )
6053
GO
6154

6255
CREATE PROCEDURE [dbo].[usp_1]
@@ -65,7 +58,7 @@ AS BEGIN ATOMIC WITH
6558
(
6659
TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'us_english'
6760
)
68-
SELECT c1, c2 from dbo.T1
61+
SELECT c1, c2 FROM dbo.T1
6962
END
7063
GO
7164

@@ -75,10 +68,10 @@ AS BEGIN ATOMIC WITH
7568
(
7669
TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'Dutch'
7770
)
78-
SELECT c1 from dbo.T1
71+
SELECT c1 FROM dbo.T1
7972
END
80-
GO
81-
82-
```
83-
73+
GO
74+
```
8475

76+
## See Also
77+
[Natively Compiled Stored Procedures](../../relational-databases/in-memory-oltp/natively-compiled-stored-procedures.md)

0 commit comments

Comments
 (0)