My Stored Procedure,
alter procedure usp_temp_tutor_details
(
@page int,
@pagesize int
)
as
begin
create table #temp_tutor_details
(
id int IDENTITY(1,1),
FacultyId int,
FacultyName varchar(50),
FacultyAddress varchar(250),
FacultyCity varchar(50),
FacultyMobile varchar(30),
FacultyExp varchar(300)
)
set identity_insert #temp_tutor_details on
insert into #temp_tutor_details(FacultyId, FacultyName, FacultyAddress, FacultyCity, FacultyMobile, FacultyExp)
select distinct tlm.Std_Fac_Id as FacultyId,
ttm.Fname as FacultyName, ttm.Faddress as FacultyAddress, ttm.Fcity as FacultyCity, ttm.Fmobile as FacultyMobile,
ttm.Fexp as FacultyExp
from tbl_loginMaster3 tlm full join tbl_tutorMastering ttm on
ttm.FacultyId = tlm.Std_Fac_Id where tlm.Role = 'faculty'
set identity_insert #temp_tutor_details on
declare @from int
declare @to int
set @to = @page - @pagesize
set @from = @page * @pagesize - @pagesize
select * from #temp_tutor_details where id > @from and id < = @to
select COUNT(*) from #temp_tutor_details
drop table #temp_tutor_details
end
Error:
Msg 545, Level 16, State 1, Procedure usp_temp_tutor_details, Line 22
Explicit value must be specified for identity column in table '#temp_tutor_details_________________________________________________________________________________________________000000000025' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.
(0 row(s) affected)
(1 row(s) affected)