Auto_Increment?
Feb 13, 2007Is there a way to add a column in my sql server db that is ging to auto increment? I would like to start at 000001 and work right on up. I can't see to find a way to do this. Thanks.
View 4 RepliesIs there a way to add a column in my sql server db that is ging to auto increment? I would like to start at 000001 and work right on up. I can't see to find a way to do this. Thanks.
View 4 RepliesHi all.
I'm trying to transfer a mysql file to mssql. Is there a field type of auto increment in mssql.If not is there anyway to make a field auto increment in the SQL Studio express?
Thanks in advance for help with this!Ron
Hi I am using visual web developer to develop my site.
Currently using uniqueID but these numbers are huge is there any way to AUTO_INCREMENT.
if so how do you do it through visual web developer as I can edit the tables etc from in there?
I've tried copying the tutorials and this is the result:
test6 below is accepted:
CREATE TABLE test6(id smallint,first_name nvarchar(50) NOT NULL,last_name nvarchar(50) NOT NULL,movie nvarchar(50) NOT NULL,PRIMARY KEY(id));
test7 below is rejected:
CREATE TABLE test7(id smallint auto_increment,first_name nvarchar(50) NOT NULL,last_name nvarchar(50) NOT NULL,movie nvarchar(50) NOT NULL,PRIMARY KEY(id));
My provider is GoDaddy, the error message is -2147217900, with "Line 2: Incorrect syntax near 'auto_increment'.
i'm trying to add an 'id' column that will auto_increment in a table that i've set up in sql enterprise server. i tried using the code:
ALTER TABLE tablename ADD id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
however, i get the following error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'ID'.
could someone please help (ASAP!!!) with how to fix this.
thanks in advance for any help.
I am trying to create a view in MSSQL that has a column which is anauto increment (or unique id) field but it doesn't work the way I wantit. Does anybody have an idea how to do this? The example below givesme only 0 in the id field.CREATE VIEW dbo.tree_x_categoriesASSELECT @@ROWCOUNTas id, *FROM <dbname>.dbo.tree_x_categoriesGOWhat I want is the fields from the table tree_x_categories plus anadditional field that has a unique identifier.Many thnx,Chris
View 3 Replies View Related