This module discussed information with respect to query basics in SQL. In the upcoming modules, you will see how this information helps you in writing your queries and
these queries can be constructed using techniques discussed in this chapter by using
- system catalogs, and
- dynamically constructed SQL.
Having completed this module, you should be able to:
- Describe how to execute your queries
- Compare and contrast batch queries with single queries
- Describe the purpose of and how to use system catalogs in your queries
- Write logic within your queries
- Describe how to construct SQL statements dynamically
This module introduced you to the following terms:
- Executing: The process of sending a query to SQL Server for processing. This is synonymous with Issuing.
- Issuing: 'The process of sending a query to SQL Server for processing. This is synonymous with Executing.
- Batch: A set of Transact-SQL commands that are sent to the SQL Server engine, all at one time. Batches are separated by GO keywords.
If there are no GO keywords in a set of Transact-SQL statements, they are all considered to be in one batch.
- System catalogs: Also known as system tables, these tables store meta-data, which is data that describes other data.
- Dynamically: A process or statement that is constructed at run-time, as opposed to compile-time.
Sometimes constructing SQL statements dynamically is necessary because the statement is constructed based on options chosen by the user.
- Optimized: The process of determining the fastest possible way to execute a query. Optimization can be simple or complex, depending on the complexity of the query or stored procedure being issued.
- SQL Server role: A group of users who are allowed the same access permission to certain objects. There are two main types of roles that come pre-installed in SQL Server
- Fixed Server Role: allowed to perform administrative functions on specific, pre-defined categories of built-in objects.
- Fixed Database Role:allowed to perform database-specific tasks, such as INSERTING, UPDATING, DELETING, or SELECTING data.
- Meta-data: Information (data) about database structures. For example, the meta-data about a table includes its name, its column names, and the filegroups in which it resides. In other words, meta-data is data about data.
In the next module, learn about selecting data from your SQL Server 2005 tables.