I've been using this tutorial to teach my self SQL Server Express using C#. This is pretty much all i know about databases, so when I search for examples or information to build on this project, I can't seem to make it fit with the end result of this tutorial.
For example, at the end of the tutorial, the author creates a primary key for the data table. I would like to be able to return the last key added. I found out that you need to use the select last_insert_id() function to do this, but how exactly is this done? I've read something about query and procedures, but I have no idé how to use them.
Could anyone explain to me how this is done? An example of getting the last created primary key for the example code in the tutorial would be greatly appreciated.
Thanks!
EDIT: Ops, I ment SELECT SCOPE_IDENTITY(), not select last_insert_id()