carl-
asked on
SQL Server to Sybase Create Table with IDENTITY field
Hi,
I'm porting create table scripts from SQL Server to Sybase 15.5
what would be the equivalent of this identity field in Sybase?
CREATE TABLE [dbo].[test]
(
TestID INT NOT NULL IDENTITY (1001, 1),
TestName NVARCHAR(50) NOT NULL
)
GO
I'm having a problem getting the syntax for the Identity Start = 1001
Thanks
I'm porting create table scripts from SQL Server to Sybase 15.5
what would be the equivalent of this identity field in Sybase?
CREATE TABLE [dbo].[test]
(
TestID INT NOT NULL IDENTITY (1001, 1),
TestName NVARCHAR(50) NOT NULL
)
GO
I'm having a problem getting the syntax for the Identity Start = 1001
Thanks
ASKER
do you know the command to separately seed its initial value?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!!
As a note, you can do it by sp_chgattribute as well:
sp_chgattribute [table_name], "identity_burn_max", 0, "[new_value]"
Check that discussion for further info:
https://www.experts-exchange.com/questions/23288053/How-to-reset-Identity-value-in-Sybase.html
sp_chgattribute [table_name], "identity_burn_max", 0, "[new_value]"
Check that discussion for further info:
https://www.experts-exchange.com/questions/23288053/How-to-reset-Identity-value-in-Sybase.html
If I've described your requirement correctly, in Sybase ASE you can't do this in one statement. You'd create the table with the appropriately sized identity, and then separately seed its initial value.