You can use the code given below, instead of using separate SELECT.
Are you interested in learning SQL from the basics! Refer to this video on SQL provided by Intellipaat:
Query:
INSERT INTO table (name)
OUTPUT Inserted.ID
VALUES('bob');
The above code only works for Non-IDENTITY columns.