Find the code snippet below which lets you do it for SQL Server:
SET IDENTITY_INSERT <TableName> ON -- Insert into the table <TableName> with the ids you prefer. SET IDENTITY_INSERT <TableName> OFF
SET IDENTITY_INSERT ON allows explicit values to be inserted into the identity column of a table.