SQL Table question - Adding a secondary key

  • I have an easy question. I need to add a secondary key to an SQL table. How would I do this?  I'm a AS400 programmer so this is work in progress for me.  I am using MS Access to import data into the table and view the SQL tables. Please help. Thanks.

  • If by key you mean unique index, then the following will work:

    create table test (col1 int primary key, col2 int)

    create unique index ux_test_col2 on test(col2)

  • Cameron,

    Don't cross post your question to different forums.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply