Thursday, May 27, 2021

Get Next Number / IDENTITY value using SQL Server

 


 create table #name ( id int identity(1,1), name varchar(10))


 drop table #tem1

INSERT INTO #name (name) 

--OUTPUT Inserted.ID

select '1111' union select '2222'

SELECT SCOPE_IDENTITY() aaa into #tem1

select * from #tem1