About 486,000 results
Open links in new tab
  1. sql - Why use the Where clause when creating an index? - Stack …

    Jun 23, 2019 · Create unique index IX_Contacts on Contacts(User_ID) Where (IsDefault=1) Says that, for each User_ID, they may have one, and only one, default contact in the Contacts table …

  2. sql server - Why use the INCLUDE clause when creating an index?

    CREATE INDEX idx1 ON MyTable (Col1) INCLUDE (Col2, Col3) The INCLUDE clause is new to me. Why would you use it and what guidelines would you suggest in determining whether to …

  3. Create a nonclustered non-unique index within the CREATE TABLE ...

    145 It is possible to create a primary key or unique index within a SQL Server CREATE TABLE statement. Is it possible to create a non-unique index within a CREATE TABLE statement?

  4. sql - Is it better to create an index before filling a table with data ...

    Sep 25, 2020 · 128 I have a table of about 100M rows that I am going to copy to alter, adding an index. I'm not so concerned with the time it takes to create the new table, but will the created …

  5. sql server - Does a foreign key automatically create an index?

    I've been told that if I foreign key two tables, that SQL Server will create something akin to an index in the child table. I have a hard time believing this to be true, but can't find much out th...

  6. What is the difference between OFFLINE and ONLINE index …

    Dec 30, 2024 · See Online Index Operations. When the process is completed the table is locked for a brief period and the new index replaces the old index. If the index contains LOB columns, …

  7. How to add an index or primary key to a user-defined table type …

    SQL Server's CREATE TYPE DDL statement supports at least two different ways of declaring the PRIMARY KEY constraint and other options. The simplest is an inline PRIMARY KEY modifier …

  8. sql server - Multiple Indexes vs Multi-Column Indexes - Stack …

    Indexes in SQL Server 2005/2008 – Best Practices, Part 1 Indexes in SQL Server 2005/2008 – Part 2 – Internals One thing to note, clustered indexes should have a unique key (an identity …

  9. Function-based indexes in SQL Server - Stack Overflow

    Mar 4, 2014 · It's similar to the function based index, except you're first naming the complete expression and associating it with the table (creating a computed column), and then as a …

  10. sql - Is it possible to add index to a temp table? And what's the ...

    27 #tablename is a physical table, stored in tempdb that the server will drop automatically when the connection that created it is closed, @tablename is a table stored in memory & lives for …