2

When using localdb and executing this, when browsing the database in sql server object explorer (in visual studio), the index is not created. I have to manually create it to make it appears. Why ?

CREATE TABLE [Instructor] (
    [ID] int NOT NULL IDENTITY,
    [LastName] nvarchar(50) NOT NULL,
    [FirstMidName] nvarchar(50) NOT NULL,
    [HireDate] datetime2 NOT NULL,
    CONSTRAINT [PK_Instructor] PRIMARY KEY ([ID])
);
4

I don't see any indexes in the Visual Studio object explorer. But if you ran that code, the index is certainly there.

Check with TSQL:

select * 
from sys.indexes
where object_id = object_id('Instructor')

Or connect with SSMS to (LocalDb)\MSSQLLocalDB and check with the SSMS object explorer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.