Collections:
CREATE INDEX - Adding an Index on an Existing Table in SQL Server
How To Create an Index on an Existing Table in SQL Server?
✍: FYIcenter.com
If you want to an index on an existing table, you can use the CREATE INDEX statement in a simple syntax:
CREATE INDEX index_name ON table_name (column_name)
The tutorial exercise below shows you how to add an index for the "in" column of the "fyi_links" table:
USE FyiCenterData; GO -- Drop the old table, if needed DROP TABLE fyi_links; GO -- Create a fresh new table CREATE TABLE fyi_links ( id INT NOT NULL, url VARCHAR(80) NOT NULL, notes VARCHAR(1024), counts INT, created DATETIME NOT NULL DEFAULT(getdate()) ); GO -- Create an index for "id" CREATE INDEX fyi_links_id ON fyi_links (id); GO -- Create an index for "url" CREATE INDEX fyi_links_url ON fyi_links (url); GO
⇒ SP_HELP - Viewing Existing Indexes on an Given Table in SQL Server
⇐ What Are Indexes in SQL Server
2016-11-15, 2238🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...
How To Round a Numeric Value To a Specific Precision in SQL Server Transact-SQL? Sometimes you need ...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How to download and install the scaled-down database AdventureWorksLT in SQL Server? If you want to ...