Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

UPSERT means INSERT and\or UPDATE, is there a standard name for a sproc that will INSERT if necessary and then SELECT?

e.g. I want to get the IS of a row that matches fields and give me the ID, if nothing matched then I want it to INSERT a new row and return me the ID of that row.

share|improve this question
Similar question has been answered here.… – Binaya Regmi Apr 3 '14 at 14:35
@BinayaRegmi, that question seems to be about implementation (which is useful as well), I just wondered if thare was a naming convention for it... Merge maybe? – BanksySan Apr 3 '14 at 14:49
MERGE is the actual SQL statement that performs the "upsert" function. I don't think there is a name for what you are describing. May be call it "inselect"? – mustaccio Apr 3 '14 at 15:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.