Search code examples
razorsql-server-ceauto-incrementwebmatrix

How do you start auto increment at a higher number in Webmatrix?


I am using SQL Sever CE and trying auto increment my table starting at 50000. I see basic SQL code out there but I do not know how to translate for Webmatrix. Do I need to use a different program to interface?


Solution

  • Once you have created your table, use the Query editor to run this:

    ALTER TABLE [MyTable] ALTER COLUMN [Id] IDENTITY (50000,1)
    

    You can reach the Query editor via the Database Workspace » Home tab » New Query