Thursday, March 31, 2016

Generate Sequence number in column

1st Way
alter table Example
add NewColumn int identity(1,1)

 
2nd Way
DECLARE @id INT

SET @id = 0

UPDATE accounts2
SET @id = id = @id + 1
GO

  





No comments:

Post a Comment