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.
Author |
Topic |
rob41
Yak Posting Veteran
67 Posts |
Posted - 2009-12-10 : 17:51:03
|
I was wondering is it possible in SQL Server 2005 to insert a autonumber field similar to what's done in access?INSERT INTO [robert_thurs_12102009] [supplier_id], [supplier_name]FROM [robert_thurs_12102009]VALUES (supplier_seq.NEXTVAL, 'K Foods');am I headed down the right path? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
behrman
Yak Posting Veteran
76 Posts |
Posted - 2009-12-25 : 21:45:24
|
alter table add id int identity (1,1) not nullcreate table a(id int identity (1,1) not null ,...)It can take any exact numeric - decimal, bigint, int, smallint, ...Remember also to put a unique index on the column as it is not guaranteed to be unique.RAQ Report: Web-based Excel-like Java reporting tool |
|
|
|
|
|