Академический Документы
Профессиональный Документы
Культура Документы
Schema: You can define schema in sql server to conceptually group related objects through
schema and then an object can be invoked as a child of its schema as:
SchemaName.ObjectName.
Example: To get all sales orders we can define a stored procedure with the name 'GetAll'
under 'SalesOrder' Schema and can be invoked like this: SalesOrder.GetAll
18. A table for error handling should be created to log errors with name
‘ErrorLog’. All application errors/exceptions must be logged in this table.
DATA TYPE USAGE GUIDELINES
ADDITIONAL GUIDELINES
19. Don’t delete, instead use an IsDeleted bit field to mark the record as deleted. Ensure
all data is filtered by this.
20. Add a couple of extra fields where needed, IsHidden and IsEnabled, that allow the
record to be filtered by the admin and the user, i.e. as an admin, I don't want a user to login
any more I set the IsEnabled to false, if later want them to login, I simply flip the flag. The
IsHidden can be used to filter items that appear in dropdown lists, for example, without
deleting it.
21. Add an autoincrement field, but not for use as the PK. This can be useful when
creating invoices, for example, and you need a visual number for the user.
22. Use functions for repeated code, i.e. we have a suite of functions that return 1st
day of month, 1st day of quarter, 1st day of year, etc.
23. When we have some functionality that requires speed, put it in the database. Move it
out of the application to a stored procedure; you gain speed but loose the strongly typed
environment.
24. Write your stored procedures so they can be tested and benchmarked.