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

Commit 8fe93de

Browse files
authored
Modify check constraints, header
1 parent b66f9e7 commit 8fe93de

1 file changed

Lines changed: 56 additions & 56 deletions

File tree

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Modify Check Constraints | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/14/2017"
4+
ms.date: "06/28/2017"
55
ms.prod: "sql-server-2016"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -21,59 +21,59 @@ ms.author: "rickbyh"
2121
manager: "jhubbard"
2222
---
2323
# Modify Check Constraints
24-
[!INCLUDE[tsql-appliesto-ss2016-all_md](../../includes/tsql-appliesto-ss2016-all-md.md)]
24+
[!INCLUDE[tsql-appliesto-ss2008-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-xxxx-xxx-md.md)]
2525

26-
You can modify a check constraint in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)] when you want to change the constraint expression or the options that enable or disable the constraint for specific conditions.
27-
28-
**In This Topic**
29-
30-
- **Before you begin:**
31-
32-
[Security](#Security)
33-
34-
- **To modify a check constraint using:**
35-
36-
[SQL Server Management Studio](#SSMSProcedure)
37-
38-
[Transact-SQL](#TsqlProcedure)
39-
40-
## <a name="BeforeYouBegin"></a> Before You Begin
41-
42-
### <a name="Security"></a> Security
43-
44-
#### <a name="Permissions"></a> Permissions
45-
Requires ALTER permission on the table.
46-
47-
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
48-
49-
#### To modify a check constraint
50-
51-
1. In the **Object Explorer**, right-click the table containing the check constraint and select **Design**.
52-
53-
2. On the **Table Designer** menu, click **Check Constraints…**.
54-
55-
3. In the **Check Constraints** dialog box, under **Selected Check Constraint**, select the constraint you wish to edit.
56-
57-
4. Complete an action from the following table:
58-
59-
|To|Follow these steps|
60-
|--------|------------------------|
61-
|Edit the constraint expression|Type the new expression in the **Expression** field.|
62-
|Rename the constraint|Type a new name in the **Name** field.|
63-
|Apply the constraint to existing data|Select the **Check Existing Data on Creation or Enabling** option.|
64-
|Disable the constraint when new data is added to the table or when existing data is updated in the table.|Clear the **Enforce Constraint for INSERTs and UPDATEs** option.|
65-
|Disable the constraint when a replication agent inserts or updates data in your table.|Clear the **Enforce For Replication** option.|
66-
67-
> [!NOTE]
68-
> Some databases have different functionality for check constraints.
69-
70-
5. Click **Close**.
71-
72-
6. On the **File** menu, click **Save***table name*.
73-
74-
## <a name="TsqlProcedure"></a> Using Transact-SQL
75-
**To modify a check constraint**
76-
77-
To modify a `CHECK` constraint using [!INCLUDE[tsql](../../includes/tsql-md.md)], you must first delete the existing `CHECK` constraint and then re-create it with the new definition. For more information, see [Delete Check Constraints](../../relational-databases/tables/delete-check-constraints.md) and [Create Check Constraints](../../relational-databases/tables/create-check-constraints.md).
78-
79-
### <a name="TsqlExample"></a>
26+
You can modify a check constraint in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)] when you want to change the constraint expression or the options that enable or disable the constraint for specific conditions.
27+
28+
**In This Topic**
29+
30+
- **Before you begin:**
31+
32+
[Security](#Security)
33+
34+
- **To modify a check constraint using:**
35+
36+
[SQL Server Management Studio](#SSMSProcedure)
37+
38+
[Transact-SQL](#TsqlProcedure)
39+
40+
## <a name="BeforeYouBegin"></a> Before You Begin
41+
42+
### <a name="Security"></a> Security
43+
44+
#### <a name="Permissions"></a> Permissions
45+
Requires ALTER permission on the table.
46+
47+
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
48+
49+
#### To modify a check constraint
50+
51+
1. In the **Object Explorer**, right-click the table containing the check constraint and select **Design**.
52+
53+
2. On the **Table Designer** menu, click **Check Constraints…**.
54+
55+
3. In the **Check Constraints** dialog box, under **Selected Check Constraint**, select the constraint you wish to edit.
56+
57+
4. Complete an action from the following table:
58+
59+
|To|Follow these steps|
60+
|--------|------------------------|
61+
|Edit the constraint expression|Type the new expression in the **Expression** field.|
62+
|Rename the constraint|Type a new name in the **Name** field.|
63+
|Apply the constraint to existing data|Select the **Check Existing Data on Creation or Enabling** option.|
64+
|Disable the constraint when new data is added to the table or when existing data is updated in the table.|Clear the **Enforce Constraint for INSERTs and UPDATEs** option.|
65+
|Disable the constraint when a replication agent inserts or updates data in your table.|Clear the **Enforce For Replication** option.|
66+
67+
> [!NOTE]
68+
> Some databases have different functionality for check constraints.
69+
70+
5. Click **Close**.
71+
72+
6. On the **File** menu, click **Save***table name*.
73+
74+
## <a name="TsqlProcedure"></a> Using Transact-SQL
75+
**To modify a check constraint**
76+
77+
To modify a `CHECK` constraint using [!INCLUDE[tsql](../../includes/tsql-md.md)], you must first delete the existing `CHECK` constraint and then re-create it with the new definition. For more information, see [Delete Check Constraints](../../relational-databases/tables/delete-check-constraints.md) and [Create Check Constraints](../../relational-databases/tables/create-check-constraints.md).
78+
79+
### <a name="TsqlExample"></a>

0 commit comments

Comments
 (0)