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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-03-02 : 08:06:13
|
| Jesus writes "I'm working on a project that is using Microsoft database server Version 8.0 2000 with service pack 3.At work we use PG for our database and we have what is called sequense tables that automatically give you the next value if you are going be inserting data. The question that I have is there anything in this database similar to the sequence tables or how is it that the primary key is created?I check all the datatypes available(bigint, binary, bit, char, datetime, decimal,float, image, int, money, nchar, ntext, numeric, nvarchar, real,smalldatetime, smallint, smallmoney, sql-varient, text, timestamp,tinyint, uniqueidentifier, varbinary, varchar), and unlike MS Access that has a autonumber this one does not have one. The closes is the uniqueidentifier and I don't really know how this one works, all I know is that is supposed to be better than other versions that use the @@IDENTITY.Could you help me?Jesus" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-02 : 08:12:54
|
| identity(1,1) will make that column to be autonumber in SQL ServeregCreate table yourTable (i int identity(1,1),.......)MadhivananFailing to plan is Planning to fail |
 |
|
|
a_r_satish
Yak Posting Veteran
84 Posts |
Posted - 2006-03-05 : 23:21:46
|
| Note : Identity can be set only when u create a table or add new columns to a table. But when u alter the column then u cannot set the identity property in ur query. Instead u can use Enterprise Manager.Regards,satish.r |
 |
|
|
|
|
|
|
|