234 Part I EXAM PREPARATION Using this facility,
234 Part I EXAM PREPARATION Using this facility, you can get virtually any data from anywhere and feed it to any destination. SELECT INTO The SELECT INTO statement can perform a data insertion and create the table for the data in a single operation. The new table is populated with the data provided by a FROM clause. A simple example of its use is as follows: SELECT * INTO ObsoleteProducts FROM Products WHERE Discontinued = 1 In the example, the SELECT INTO creates a new table ObsoleteProducts with an identical structure as the products table. It then copies all data that meets the WHERE condition into this newly created table. It is possible to combine data from several tables or views into one table, and again a variety of sources can be used. Deleting Data Data that is not needed can be deleted using the DELETE statement. The DELETE statement removes one or more records from a table based on a condition in the WHERE clause. A simplified version of the DELETE statement is DELETE table_ or_view FROM table_sources WHERE .search_condition Table_or_view names a table or view from which the rows are to be deleted. All rows in table_or_view that meet the qualifications of the WHERE search condition are deleted. If a WHERE clause is not specified, all the rows in table_or_view are deleted. If you would like to delete all rows, a fast, non-logged method is already supplied: TRUNCATE TABLE. It immediately frees all space used by indexes and data by that table, as opposed to DELETE, which should be used when partial data removal is desired. Though both TRUNCATE TABLE and a DELETE statement with no WHERE clause remove all rows in a table, TRUNCATE TABLE is faster and uses fewer system and log resources. The DELETE statement removes rows one at a time, recording an entry in the transaction log for each row. TRUNCATE TABLE removes the data by de-allocating the data pages used to store the table s data, and only the page de-allocations are recorded in the log. TRUNCATE TABLE removes all rows from a table, but the
For high quality website hosting services please check cheap web hosting website.