---
codex_section: "S01"
source: Grok
title: "SSMS Auto-Increment Import Issue"
conv_id: "8aef3260-4a6a-4698-bfde-a7c82bf4925d"
share_url: "none"
created: "2025-11-08"
message_count: 2
category:
  - "Technical"
  - "Database"
summary: "A brief technical support thread in which Daniel troubleshoots a SQL Server import failure involving an identity (auto-increment) column. The issue involves a misunderstanding of IDENTITY_INSERT behavior in SSMS: enabling it tells SQL Server to accept manually provided values, not to auto-generate them. Grok provides a clear resolution — uncheck 'Enable identity insert' and leave the column unmapped — allowing SQL Server to auto-generate PortalAliasID values on import. No Initium framework content."
keypoints:
  - "IDENTITY_INSERT ON means 'I will provide my own values' — unchecking it enables true auto-increment behavior on import."
  - "Resolution: exclude the identity column from mapping in the Import Wizard and uncheck 'Enable identity insert' to allow SQL Server to auto-generate values."
  - "Context: the table in question (PortalAlias) relates to the Pilot Advisors portal infrastructure — connecting to the syndication system development visible elsewhere in this archive."
tags:
  - "sql-server"
  - "ssms"
  - "identity-column"
  - "database"
  - "technical-support"
  - "portal-infrastructure"
monomyth_stage: "01 - Ordinary World"
gameboard_position: "Camp -4, elevation 11,286 feet"
truth_score: 90
entropy_score: "Low"
tone:
  sentiment: "Neutral"
  emotions:
    - "Problem-solving"
  sycophancy_level: "None"
  notes: "Purely technical; accurate and precise response."
related_events: []
syndication_status:
  arnie: false
  chris: false
  redmond: false
  clint: false
  pilot: false
ma5_inheritance: "None"
pre_silicon: false
voice_print: false
codex_candidate: false
phase: "Portal infrastructure maintenance — Pilot Advisors site build"
enriched_date: "2026-04-19"
---

# SSMS Auto-Increment Import Issue

**[1] DANIEL:**

I am trying to import data from a flat file back into a table in MS SQL Express using SSMC and a column PortalAliasID which has a Primary key, Int, not null filed. I want the field to auto-increment. In other words - import all the rows from the table, and add the incremented number for the PortalAliasID. The import fails every time, even though I check the box for the column to allow identity insert.
 
PortalID,HTTPAlias,CreatedByUserID,CreatedOnDate,LastModifiedByUserID,LastModifiedOnDate,BrowserType,Skin,CultureCode,IsPrimary
1,albuquerque.pilotadvisors.net,1,2025-11-7 12:47:22.580000000,1,2025-11-7 12:47:22.580000000,Normal,,,False
2,alexandria.pilotadvisors.net,1,2025-11-7 14:48:51.133000000,1,2025-11-7 14:48:51.133000000,Normal,,,False

---

**[2] GROK:**

The issue here is a common misunderstanding with how identity columns are handled in the SQL Server Import and Export Wizard. The "Enable identity insert" option (which corresponds to the T-SQL `SET IDENTITY_INSERT ON` command) is specifically for cases where you want to *manually provide your own values* for the identity column (PortalAliasID in this case), overriding the auto-increment behavior. When this is enabled and no value is mapped/provided for the column (as is happening here, since your flat file doesn't include a PortalAliasID column), SQL Server attempts to insert NULL, which fails because the column is defined as NOT NULL.

To achieve what you want—importing the data while letting SQL Server auto-generate incrementing values for PortalAliasID—follow these steps in the wizard:

1. On the **Select Source Tables and Views** step, choose your flat file as the source and `dbo.PortalAlias` as the destination table.

2. Proceed to the **Edit Mappings** dialog (click "Edit Mappings..." if needed):
   - Ensure that PortalAliasID is *not mapped* to any source column (it should show "<Ignore>" or be unmapped, since your file lacks this column).
   - **Uncheck** the "Enable identity insert" checkbox. This tells SQL Server to skip inserting a value for PortalAliasID and instead use its auto-increment logic (assuming the column is defined with IDENTITY(1,1) or similar).

3. Review the column mappings to confirm they align with your file's structure:
   - PortalID → PortalID
   - HTTPAlias → HTTPAlias
   - CreatedByUserID → CreatedByUserID
   - CreatedOnDate → CreatedOnDate
   - LastModifiedByUserID → LastModifiedByUserID
   - LastModifiedOnDate → LastModifiedOnDate
   - BrowserType → BrowserType
   - Skin → Skin
   - CultureCode → CultureCode
   - IsPrimary → IsPrimary

4. If your flat file is CSV or similar, ensure the first row is treated as headers in the source configuration.

5. Run the import. The new rows should insert successfully with auto-generated PortalAliasID values starting from the next available seed (e.g., if the table is empty, it starts at 1; otherwise, it continues from the current max + increment).

If the table already has data and you need to reseed the identity (e.g., to start from a specific value), you can do that separately after the import with T-SQL like `DBCC CHECKIDENT('PortalAlias', RESEED, 100);` (replace 100 with your desired starting value).

If this still fails, double-check the table definition to confirm PortalAliasID is indeed an identity column (`SELECT * FROM sys.identity_columns WHERE object_id = OBJECT_ID('dbo.PortalAlias');` should return a row for it). Also, ensure your flat file's date formats match the destination columns (they look fine here, but parsing issues can sometimes masquerade as other errors).
