CS 112D Lecture Notes - SQL Server Part 2 (Chapter 3 after page 91)
Note
If you don't have a full installation of SQL Server on your computer, the SQL Query Analyzer and related
tools described in your book won't be available to you. These tools do not come with the MSDE.
Views are like queries in Microsft Access - they are stored in the database and can be queried
like a table.
Stored Procedures
- Stored Procedures allow you to:
- Perform calculations on data
- Take or return parameters (@ used to designate parameter, e.g. @custID )
- Implement application logic that requires multiple steps using a language like VB
- Return data in an easy, efficient way for the client to handle.
- For SQL Server, the language for stored procedures is Transact-SQL. Future versions of SQL
Server are supposed to be able to use any .NET language for stored procedures.
- sp_helptext followed by the name of a view or stored procedure is used to display its code.
Advanced SQL Server Features
- a trigger is a special kind of stored procedure that's automatically executed when data is
updated, deleted, or inserted into a table. Used for more customized behavior than simple Cascading
Updates or Cascading Deletes.
- User names, passwords, and permissions can be set up in SQL Server to allow only designated
individuals to access particular databases.
Return to the main CS 112D page