Thank you so much guys for your contribution.
I have found the solution.
we can use
Instead off trigger to achieve this into SQL Server.
CREATE OR ALTER TRIGGER schema_name.trigger_name
ON schema_name.table_name
INSTEAD OF INSERT
AS
BEGIN
Declare @loc_count int;
DECLARE @table_variable TABLE(LOC_ID INT);
set @loc_count=(select count(*) from inserted where inserted.id is null);
Insert into schema_name.table_name
select * from inserted where id is not null;
select * into #temp from inserted where id is null;
WHILE @loc_count > 0
BEGIN
INSERT INTO @table_variable(LOC_ID)
SELECT NEXT VALUE FOR schema.sequence_name;
WITH update_first_row AS
(
SELECT TOP 1 *
FROM #temp
where id is null
)
update update_first_row
set id=(SELECT LOC_ID from @table_variable)
FROM update_first_row;
DELETE FROM @table_variable;
set @loc_count=@loc_count-1;
END;
INSERT INTO schema.table_name
SELECT * FROM #TEMP;
DROP TABLE #TEMP;
END;
I have just inserted all the rows having id as null into a temp table and then assigning sequence number to one row at a time without altering the column definition.