You are on page 1of 1

Database Important Point

1. PERSISTED Column: - SQL Server 2005 database engine applies the PERSISTED Keyword in CREATE and ALTER Table statement to physically stored column in table. CREATE TABLE Price (Qty Int, UnitPrice int, Total as Qty*UnitPrice PERSISTED); 2. 4096 expression maximum possible with SELECT statement. 3. Cant specify ALL with the ROLLUP or CUBE operator in GROUPBY. 4. GROPUBY ALL is not supported in query that access remote table if there is also a WHERE clause in the query. 5. When GROUPBY is not used HAVING clause is used like where clause. 6. The ORDERBY clause is not valid in VIEWS, In-Line function, derived tables and subqueries, unless TOP is also specified. 7. ORDERBY operation should be performed according to the collation specified in collation_name and not according to the collection of the column as defined in the table or view. Collation_name can be either WINDOWS collation name or SQL Collation name. COLLATE is applicable only on the column type of char, nchar,varchar and nvarchar datatypes. 8. Subquery cant include COMPUTE or FOR BROWSE clause and may only include an ORDERBY clause when TOP is include. 9. Upto 32 nesting level of subquey is possible. 10. TRUNCATE removes all rows from table without logging individual row deletion. TRUNCATE is similar with DELETE with no WHERE clause. 11. When a row modified through a view, the WITH CHECK option makes sure that data remains visible through the view after the modification is commited. 12. WITH CHECK Option cant be specified if TOP is used anywhere in select statement. 13. Encrypts the entries in sys.syscomments that contain the text of CREATE VIEW statement. Using WITH ENCRYPTION prevents the VIEW from being published as a part of Sql Server Replication. 14. SCHEMABINDING- Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified. When you use SCHEMABINDING, the select statement must include the twopart names (schema object) of tables, views, or user-defined functions that are referenced. All referenced objects must be in the same database. Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unless that view is dropped or changed so that it no longer has schema binding. Otherwise, the Microsoft SQL Server 2005 Database Engine raises an error. Also,executing ALTER TABLE statements on tables that participate in views that have schema binding fail when these statements affect the view definition. SCHEMABINDING cannot be specified if the view contains alias data type columns.