SQL Synax Problem

Alphathree33

Platinum Member
Dec 1, 2000
2,419
0
0
command.CommandText = "CREATE TABLE Documents (" +
"ID INTEGER NOT NULL DEFAULT AUTOINCREMENT PRIMARY KEY," +
"FileName VARCHAR(256) NOT NULL," +
"Content LONGVARCHAR," +
"username VARCHAR(64) references Users );";


The backend is SQL Server 2000. The error is that AUTOINCREMENT is "not permitted in this context."

I think what I'm trying to do is obvious.

Thoughts?
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
If you want an auto incrementing field look up identity: ID int NOT NULL IDENTITY (1, 1). That'll auto increment by 1 for each new row. You might want to look up some more references whilst you are at it....
 

Alphathree33

Platinum Member
Dec 1, 2000
2,419
0
0
Okay, I got one more for you...

It doesn't like "LONGVARCHAR"...

What data type in SQL 2000 is equivalent to the MS Access "Memo"? (i.e. an indefinitely long string like an HTML file or XML doc)