Create SQL Syntax for table with identity field getting error parameter is incorrect

i have the database schema and have code to create the databases on the fly.
i have everything working but for the life of me can't get the identity field to create.
please help

I am trying to run the following command.

create table Member(ID integer identity, Email varchar(255) not null)

i continue to get the error parameter is incorrect

also tried
create table Member(ID integer identity(1,1) not null, Email varchar(255) not null)


have also tried

alter table member add field Id integer identity.

i am at a lost. everything i read says this should work
LVL 8
AutoeformsAsked:
Who is Participating?
 
nmcdermaidCommented:
What if you put square brackets around the name if the 'ID' field?


create table Member([ID] int identity(1,1) not null, Email varchar(255) not null)
0
 
ColosseoCommented:
Hi

does this work specifying int rather than integer

create table Member(ID int identity(1,1) not null, Email varchar(255) not null)

apart from that it looks fine

Scott
0
 
BillAn1Commented:
can you give the exact error message you are getting (and also how are you running the command - are you running as part of a script in QA?)
both of the create scripts you gave above work fine for me.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Eugene ZCommented:


in QA click CTRL+N
copy\paste there

UISE yourDBname
go
drop table Member
create table Member(ID integer identity(1,1) not null, Email varchar(255) not null)
0
 
Eugene ZCommented:
typo:
in QA click CTRL+N
copy\paste there

USE yourDBname
go
drop table Member
create table Member(ID integer identity(1,1) not null, Email varchar(255) not null)
0
 
AutoeformsAuthor Commented:
Still Not good.

I tried the the create statement on the table

the program throws an error in a message box "The Parameter Is InCorrect"

I have a vb.net program with a sql statement trying the command i get the message back in error text

I copied the text and tried it from a stored procedure in access with the same result.

still
0
 
nmcdermaidCommented:
Try it in Query Analyzer. That will verify wether the SQL is correct and you can work your way back up to find out at which level the error is occuring.
0
 
rafranciscoCommented:
Please post the part in your VB.NET application that sends the command to SQL Server.
0
 
GregWeberCommented:
thanks
i took the example from above and started from scratch and everything worked.
the command still does not work in access but at this point that was not my concern

cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.