<< < 39 40 41 42 43 44 45 46 47 48 49 > >>   ∑:1243  Sort:Rank

"ALTER TABLE ... ALTER COLUMN" - Changing Column Data Type in SQL Server
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Sometimes, you may need to change the data type of an existing column. For example, you want increase the string length of a column. You can use the "ALTER TABLE ... ALTER COLUMN" statements in the followi...
2016-11-15, 2990🔥, 0💬

What Are Indexes in SQL Server
What Are Indexes in SQL Server? An index is a secondary database object associated with a table to improve the retrieval performance of rows from that table. An index can be defined for a single column or multiple columns of a given table. If an index is defined on a single column of a table, the in...
2016-11-15, 2428🔥, 0💬

"sp_rename ... 'OBJECT'" - Renaming Existing Tables in SQL Server
How to rename an existing table with the "sp_rename" stored procedure in SQL Server? If you have an existing table and you want to change the table name, you can use the "sp_rename ... 'OBJECT'" stored procedure. "sp_rename" allows you to change names of COLUMN, DATABASE, INDEX, USERDATATYPE, and OB...
2016-11-15, 2254🔥, 0💬

sys.indexes - Viewing Existing Indexes on an Given Table in SQL Server
How To View Existing Indexes on an Given Table using sys.indexes in SQL Server? Another way to view existing indexes defined for a given table is to use the system view called "sys.indexes". The tutorial exercise shows you how many indexes were defined from the previous tutorial on table "fyi_links"...
2016-11-15, 1902🔥, 0💬

Understanding and Managing Indexes in SQL Server
Where to find answers to frequently asked questions on Understanding and Managing Indexes in SQL Server? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Understanding and Managing Indexes in SQL Server. Clear answers are provided with tutorial exe...
2016-11-15, 1503🔥, 0💬

Renaming an Existing Column with Management Studio in SQL Server
How to rename an existing column with SQL Server Management Studio in SQL Server? If you are using SQL Server Management Studio, you can rename almost any data objects through the Object Explorer window. The tutorial example below shows you how to rename a column: 1. Run SQL Server Management Studio...
2016-11-15, 1471🔥, 0💬

SP_HELP - Viewing Existing Indexes on an Given Table in SQL Server
How To View Existing Indexes on an Given Table using SP_HELP in SQL Server? If you want to know how many indexes have been defined for a given table, you can use the SP_HELP built-in stored procedure in the following syntax: EXEC SP_HELP table_name -- Returns all database objects related the given t...
2016-11-15, 1444🔥, 0💬

CREATE INDEX - Adding an Index on an Existing Table in SQL Server
How To Create an Index on an Existing Table in SQL Server? 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...
2016-11-15, 1380🔥, 0💬

DROP INDEX - Removing Existing Indexes in SQL Server
How To Drop Existing Indexes in SQL Server? For some reason, if you want remove an existing index, you can use the DROP INDEX statement with following syntax: CREATE INDEX table_name.index_name The tutorial exercise below shows you how to remove the index "fyi_links_id": USE FyiCenterData; GO SELECT...
2016-11-15, 1329🔥, 0💬

"DROP TABLE" - Deleting Existing Tables in SQL Server
How To Drop an Existing Table with "DROP TABLE" Statements in SQL Server? If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below: SELECT * FROM tipBackup GO id subject description create_date 1 Learn SQL Visit dev.fyice...
2016-11-15, 1294🔥, 0💬

Measuring Performance of INSERT Statements in SQL Server
How To Measure Performance of INSERT Statements in SQL Server? When indexes are defined for a table, each time a new row is inserted to the table, all the indexes must be updated. This extra update work could slow down the insert statement. To find out how much slower the INSERT statements will be o...
2016-11-13, 2425🔥, 0💬

Creating a Large Table with Random Data for Indexes in SQL Server
How To Create a Large Table with Random Data for Index Testing in SQL Server? If you want to see how index can be used to improve data search performance, you have to build some large tables, which requires large amount of random data. This tutorial exercise helps you to build a large table with pur...
2016-11-13, 2052🔥, 0💬

Index Slowing Down INSERT Statements in SQL Server
Does Index Slows Down INSERT Statements in SQL Server? If you want to see the impact of indexes on INSERT statements, you can repeat the same insert script on the table "fyi_links" of the same structure with two indexes: one non-clustered index on column "url" and one non-clustered index on column "...
2016-11-13, 1533🔥, 0💬

Index Speeding Up SELECT Statements in SQL Server
Does Index Speed Up SELECT Statements in SQL Server? If you want to see the impact of indexes on SELECT statements, you can run the same SELECT statement on "fyi_links" and "fyi_links_indexed" tables. See the tutorial exercise below: USE FyiCenterData; GO -- Run SELECT on the table without indexes D...
2016-11-13, 1494🔥, 0💬

Difference Between Clustered and Non-Clustered Indexes in SQL Server
What Is the Difference Between Clustered and Non-Clustered Indexes in SQL Server? SQL Server 2005 supports two types of indexes: clustered index and non-clustered index. Here are the main differences between them: One table can only have only one clustered index. One table can only have many non-clu...
2016-11-13, 1423🔥, 0💬

Creating an Index for Multiple Columns in SQL Server
How To Create an Index for Multiple Columns in SQL Server? An index for multiple columns works similarly to a sorting process on multiple columns. If an index is defined for two columns, the index key is composed by values from those two columns. A multi-column index will be used to speed up the sea...
2016-11-13, 1406🔥, 0💬

CREATE CLUSTERED INDEX - Adding Clustered Indexes in SQL Server
How To Create a Clustered Index in SQL Server? If there is no primary key in a table, you can add one clustered index to that table with CREATE CLUSTERED INDEX statement. The tutorial exercise below shows you how to create a clustered index: USE FyiCenterData; GO -- Drop the old table, if needed DRO...
2016-11-13, 1405🔥, 0💬

UNIQUE Constraint Creating Default Index in SQL Server
Does the UNIQUE Constraint Create an Index in SQL Server? If you add the UNIQUE constraint on a column, SQL Server will automatically add a non-clustered index for that column. The tutorial exercise below shows you the index created as part of the UNIQUE column, "id", of "fyi_links": USE FyiCenterDa...
2016-11-13, 1400🔥, 0💬

Adding a New Index to a Large Table in SQL Server
What Happens If You Add a New Index to Large Table in SQL Server? An index can be added when you create a new table. New rows will be indexed as they are inserted into the table. But you can also add a new index to an existing table with the same CREATE INDEX statement. The existing rows will be ind...
2016-11-13, 1388🔥, 0💬

Primary Key - Default Indexes of Tables in SQL Server
Is the PRIMARY KEY Column of a Table an Index in SQL Server? If you define a primary key on a table, an index for the primary key column will be created by default. The tutorial exercise below shows you the index created as part of the primary key column of "fyi_links": USE FyiCenterData; GO -- Drop...
2016-11-13, 1348🔥, 0💬

DROP_EXISTING - Recreating an Existing Index in SQL Server
How To Recreate an Existing Index in SQL Server? If you want to change the definition of an existing index, you can use the "DROP INDEX" statement to drop the index first. Then use the "CREATE INDEX" statement to create it again with the new definition. But you can also combine those two statements ...
2016-11-08, 2731🔥, 0💬

"ALTER INDEX ... REBUILD" - Defragmenting Indexes in SQL Server
How To Rebuild Indexes with ALTER INDEX ... REBUILD in SQL Server? When an index is defragmented to a large percentage, like &gt; 30%, you can use the "ALTER INDEX ... REBUILD" statement to rebuild the index. Here is a tutorial exercise on rebuilding indexes: USE FyiCenterData; GO UPDATE fyi_lin...
2016-11-08, 2080🔥, 0💬

What Causes Index Fragmentation in SQL Server
What Causes Index Fragmentation in SQL Server? Index fragmentation is usually caused by deleting of existing rows or updating existing values of the indexed column. Inserting new rows should not cause any index fragmentation. This tutorial exercise shows you how update statements of 50000 rows on th...
2016-11-08, 1999🔥, 0💬

"ALTER INDEX ... REORGANIZE" - Defragmenting Indexes in SQL Server
How To Defragment Indexes with ALTER INDEX ... REORGANIZE in SQL Server? When an index is defragmented to a small percentage, like &lt; 30%, you can use the "ALTER INDEX ... REORGANIZE" statement to defragment the index. Here is a tutorial exercise on defragmenting indexes: USE FyiCenterData; GO...
2016-11-08, 1914🔥, 0💬

<< < 39 40 41 42 43 44 45 46 47 48 49 > >>   ∑:1243  Sort:Rank