Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Server CE 3.5 AutoIncrement

SQL Server CE 3.5 AutoIncrement

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Searril
    wrote on last edited by
    #1

    Hello, I've googled far and wide and this is one of those rare things I just can't seem to find an answer for. Hopefully it's easy, but this is my first time ever playing with SQL Server CE and the answer eludes me. All I want to do is reset my AutoIncrement column back to 1 when I clear the table. DBCC CHECKIDENT apparently is not supported in CE and I can't find a way to do it. Can anyone help? Thanks much.

    W 1 Reply Last reply
    0
    • S Searril

      Hello, I've googled far and wide and this is one of those rare things I just can't seem to find an answer for. Hopefully it's easy, but this is my first time ever playing with SQL Server CE and the answer eludes me. All I want to do is reset my AutoIncrement column back to 1 when I clear the table. DBCC CHECKIDENT apparently is not supported in CE and I can't find a way to do it. Can anyone help? Thanks much.

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Try ALTER TABLE command like following:

      ALTER TABLE TableName ALTER COLUMN ColumnName IDENTITY(1,1)

      The need to optimize rises from a bad design. My articles[^]

      S 1 Reply Last reply
      0
      • W Wendelius

        Try ALTER TABLE command like following:

        ALTER TABLE TableName ALTER COLUMN ColumnName IDENTITY(1,1)

        The need to optimize rises from a bad design. My articles[^]

        S Offline
        S Offline
        Searril
        wrote on last edited by
        #3

        That worked brilliantly. Thank you! I should've thought of that from the start.

        W 1 Reply Last reply
        0
        • S Searril

          That worked brilliantly. Thank you! I should've thought of that from the start.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          You're welcome.

          The need to optimize rises from a bad design. My articles[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups