Tag: index

How to list indexes and the column names?

-- Lists user indexes that are not primary and not unique indexes in SQLServer 2005 and up select t.name as table_name , ind.name as index_name , ic.index_column_id -- column order in the index , col.name from sys.indexes ind inner join sys.index_columns ic on ind.object_id = ic.object_id and ind.index_id = ic.index_id inner join sys.columns col on … Continue reading How to list indexes and the column names?

How to find sizes of all tables in SQLServer?

By executing the store procedure sp_spaceused '<table>' one can find the space used by a table. The store procedure returns amount of space used by data, index and unused space. Here is the documentation on sp_spaceused from Microsoft. Using the following link you can use the store proc below to return for all tables in … Continue reading How to find sizes of all tables in SQLServer?

Information on flashback feature in 10g

One of the features in 10g is flashback which allows to restores tables that were dropped. Note: If an index is dropped but not a table it can't be restored from flashback but if a table is dropped that has an index you can restore the table and the index from flashback. The example below … Continue reading Information on flashback feature in 10g