title: How to insert a record and return the newly created ID using a single SqlCommand?
body: <p>I'm using an SqlCommand object to insert a record into a table with an autogenerated primary key. How can I write the command text so that I get the newly created ID when I use the ExecuteScalar() method?</p>