I am into migrating some Oracle DML queries to SQL Server. The DML statements has RETURNING clause in them. For example :

insert into test select col1,col2 from table2 RETURNING col1 INTO variable

Here the RETURNING clause is used to get the data in the rows affected by the DML statement.

Is there a way to achieve this in SQL Server ?