# SQL Server Rule: SML038
| | |
|----|----|
| Assembly | TSQLSmellSCA |
| Namespace | TSQLSmellSCA |
| Class | TSQLSmellSCA38 |
## Rule Information
| | |
|----|----|
| Id | SML038 |
| Friendly Name | Primary Key Constraints on temporary tables should not be named |
| Category | CodeSmells |
| Ignorable | false |
| Applicable Types | Model |
## Description
Primary Key Constraints on temporary tables should not be named
### Examples
```sql
CREATE PROCEDURE [dbo].[TempTableWithNamedPK]
AS
SET nocount on;
Create table #1
(
ID integer primary key
)
Create table #2
(
ID integer,
Constraint [PKID] primary key (ID)
);
CREATE TABLE #Table1 (
ColumnOne VARCHAR(10) NOT NULL,
ColumnTwo VARCHAR(10) NOT NULL,
PRIMARY KEY (ColumnOne, ColumnOne)
);
RETURN 0
-- SML038
```
<sub><sup>Generated by a tool</sup></sub>