Paul Rice
April 11th, 2003, 05:47 PM
I'm using ODBC and SQL to create a primary key column in a table.
My sql is:
Alter Table Dept Add No INTEGER Not NULL, constraint No_pkey PRIMARY KEY (No)
I got this code from MSDN but it doesn't work. I know that if I try to create a column with just the Not NULL constraint, the column will be created but NULL will be possible. The column needs to be NOT NULL inorder for it to be a primary key. What am I doing wrong?
Thanks,
Paul
My sql is:
Alter Table Dept Add No INTEGER Not NULL, constraint No_pkey PRIMARY KEY (No)
I got this code from MSDN but it doesn't work. I know that if I try to create a column with just the Not NULL constraint, the column will be created but NULL will be possible. The column needs to be NOT NULL inorder for it to be a primary key. What am I doing wrong?
Thanks,
Paul