Are you referring to incrementing a unique row identifier as in an Oracle sequence? If so, SQL Server uses an identity function that is defined for a column at table creation. The identity column autoincrements as each new row is inserted into the table.
i tried it but i am getting the following message. i did it creation of table level only. i want to use the column at the procedure and increment a column at table level.
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'ResponseID', table 'new sugar.dbo.Tmp_TenderApproval'; column does not allow nulls. INSERT fails.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.
One can have only one Identity column in SQl server which is usually Primary key which obviously does not accept null.
From the error looks like this is not a Primary key column for you and you still want to increment it automatically and is defined as not null.
Are you trying to generate a number for non Primary key column ???