Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Auto_Increment question

Author  Topic 

John T.
Posting Yak Master

112 Posts

Posted - 2003-04-26 : 09:42:13
CREATE PROCEDURE test AS
CREATE TABLE AutoNum (IDNo auto_increment NOT NULL,
total DEC(3,1)
PRIMARY KEY (IDNo))
GO
From the searches I have done, I think this should work. I get an error that "Column or parameter #1 : Cannot find data type auto-increment."
I have placed "INT" and "SMALLINT" before the "auto_increment". By the way, should a DEFAULT 1 set the beginning value of IDNo to 1?
Thanks very much.

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-04-26 : 09:51:23
quote:

CREATE PROCEDURE test AS
CREATE TABLE AutoNum (IDNo auto_increment NOT NULL,
total DEC(3,1)
PRIMARY KEY (IDNo))
GO
From the searches I have done, I think this should work. I get an error that "Column or parameter #1 : Cannot find data type auto-increment."
I have placed "INT" and "SMALLINT" before the "auto_increment". By the way, should a DEFAULT 1 set the beginning value of IDNo to 1?
Thanks very much.





I think u need to use identity(seed,increment) like identity(1,1)
instead of auto_increment.

regards,
harshal.

Expect the UnExpected
Go to Top of Page

John T.
Posting Yak Master

112 Posts

Posted - 2003-04-26 : 10:01:07
Identity was the thing. Thanks. Learned something. Appreciate it.

Go to Top of Page
   

- Advertisement -