|
-
April 11th, 2003, 05:47 PM
#1
Trying to create a primary key with code
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|