fortuna_techmy
asked on
alter table TB alter column rNo IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
Greetings.
I want change all the Running no from
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT NULL
to
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
2 problems :
a) I cannot use ALTER TABLE to change it to IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL. Note all the tables already have records
b) All the tables need to be changed. I need to use a while loop to go thru all the tables (excluding system tables) and update to [Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
Thank you.
CREATE TABLE [dbo].[test] (
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[icno] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_ AS NOT NULL ,
[name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_ AS NULL
) ON [PRIMARY]
GO
alter table test alter column
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
I want change all the Running no from
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT NULL
to
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
2 problems :
a) I cannot use ALTER TABLE to change it to IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL. Note all the tables already have records
b) All the tables need to be changed. I need to use a while loop to go thru all the tables (excluding system tables) and update to [Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
Thank you.
CREATE TABLE [dbo].[test] (
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[icno] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_
[name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_
) ON [PRIMARY]
GO
alter table test alter column
[Rno] [numeric](18, 0) IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.