|
-
Sep 2nd, 2008, 11:46 PM
#1
Thread Starter
Lively Member
SQL Insert using MAX
To all the SQL junkies out there,
I am trying to insert a new record with a primary key like this "A0024". Is there a way I can increment on insert using a sql statement?
Also another problem i'm having is trying to add a new record using the max command?
I have tried:
"INSERT INTO TableName VALUES(MAX(FieldName)+1)"
And also tried:
"INSERT INTO TableName VALUES((SELECT MAX(FieldName)+1 FROM TableName))"
Thanks in advance.
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
|