Autonumber to Int

Posted on 2011-05-05
Last Modified: 2012-05-11
I had an Access database but just converted the backend tables to SQL Server.  A number of my primary keys were autonumber in the old system but now they are integer.  How do I deal with auto-incrementing object IDs now?
Question by:gcgcit
    LVL 6

    Accepted Solution

    open sql enterprise management studio

    select the table you want to modify

    right click the table and choose modify or design

    locate your field and click it so the arrow is pointing at it.

    now below in your column properties you will see Identity Specification open that tree
    select (Is Identity) to be Yes

    save table


    Author Comment

    I found info that I need to set my indentity increment and identity seed to 1 but they are already set to that.  In the application when I'm trying to create a new record the task bar says "Cannot add record(s); primary key for table 'tblPeople" not in recordset"

    Author Comment

    tblPeople that I'm trying to edit is a subform, are maybe my relationships messed up?
    LVL 6

    Expert Comment

    Thats possible.

    Also you can right click and set to primary key
    LVL 26

    Expert Comment

    If you still can yet, I recommend you use the (free) SQL Server Migration Assistant for MS Access

    It ain't perfect (yet) but it beats the daylights out of manual conversion or the upszing wizard.
    It'll analyze your db, move the tables, add the timestamp fields and create the link tables.

    Fairly well-dcoumented, and google-able

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now