Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
106 views

Is unique index combined with a "not null" constraint equivalent to a PK constraint?

I have these legacy table definitions (from here): CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, -- lots of other columns CONSTRAINT [PrimaryKey_GUID_HERE] ...
sharptooth's user avatar
  • 1,331
13 votes
3 answers
68k views

Listing indexes and constraints

I am looking at a SQL Server database for an application I have inherited. I have not looked into SQL Server for approximately 10 years, so please bear with me. The database table I am looking at has ...
ali haider's user avatar
5 votes
1 answer
9k views

Unable to drop non-PK index because it is referenced in a foreign key constraint

I have a table named MyTable. The primary key is an identity int column named MyTableID. There is a unique clustered index on the PK column MyTableID named PK_MyTable. I noticed there is an ...
RedFilter's user avatar
  • 228