Adding a key to a table
Keys are used to make sure every record in the table is unique. They are often also referred to as indexes and used to sort your data in ways that are most beneficial to the user.
How to do it...
Follow the steps from the Creating a table recipe to create a table.
Click on Design from Object Designer to open the Table Designer for that table.
Click on View | Keys (Alt + V, K).
On an empty line, add a new key for Document No., Posting Date.
Your keys should look like the following window:
Close the Keys window.
Save and close the table.
How it works...
Keys allow you to sort data in a way that will increase your application's performance. There is a trade-off, though. Increased application performance later, costs you some effort earlier.
When we insert data into a table it is automatically sorted based on the primary key of that table, but what about the other keys? The database engine doesn't just magically know how records should be sorted. For every key, the database...