Create SQL identity as primary key?

前端 未结 3 1601
猫巷女王i
猫巷女王i 2020-12-28 13:07
create table ImagenesUsuario
{
    idImagen int primary key not null IDENTITY
}

This doesn\'t work. How can I do this?

3条回答
  •  无人及你
    2020-12-28 13:35

    If you're using T-SQL, the only thing wrong with your code is that you used braces {} instead of parentheses ().

    PS: Both IDENTITY and PRIMARY KEY imply NOT NULL, so you can omit that if you wish.

提交回复
热议问题