Monday 6 November 2017

SQL Server creating table with clustered index without a primary key

Yes, it is possible to create a clustered index that is not the primary key. Just use a CREATE CLUSTERED INDEX statement.
CREATE TABLE dbo.myTable (
    myTableId int PRIMARY KEY NONCLUSTERED
    myColumn int NOT NULL
)

CREATE CLUSTERED INDEX myIndex ON dbo.myTable(myColumn)

1 comment:

  1. Thank you so much for providing information about SQL and many other aspects of it to help about solving toughest and most complex IT databases problems and solutions.

    SQL Server Load Soap API

    ReplyDelete

C# LINQ Joins With SQL

There are  Different Types of SQL Joins  which are used to query data from more than one database tables. In this article, you will learn a...