0

I am using SQL Server 2008 Express. In the DB in question, there is only one schema: dbo.

If I run the following script:

CREATE UNIQUE INDEX IX_ClientSocialTypes_Cover
ON ClientSocialTypes(ClientID, SocialTypeClassID, [Source]) INCLUDE (URLID);

... it executes ok, but I cannot see the index when I go into DB Diagram and view the indexes for this table. Further, the "Includes" field is always grayed out, even when I specify non-clustered index (hence my use of a script).

Any ideas?

IamIC
  • 17,747
  • 20
  • 91
  • 154
  • 1
    See the index where??? Did you refresh the DB diagram after creating the index?? Stupid question: are you sure you're creating the index in the same database as you're looking at in the diagram?? – marc_s Nov 15 '10 at 13:26
  • 1
    See the index on "Table right-click, Indexes/Keys". Good grief, I don't believe it. I had to reload the diagram and then it showed!! I am used to the IDE keeping things in sync (such as table edits instantly appear updated). Doh. But... I still don't get why I can't use the IDE to create covering indexes. – IamIC Nov 15 '10 at 13:30

2 Answers2

2

Where are you trying to see the index? Did you refresh the database diagram after creating the index?

Update: ok, it seems that in the diagram editor, you cannot define included columns (always grayed out - even in full SSMS, on SQL Server 2008 R2 Dev Edition).

But in the table designer (right-click on (your table name) > Indexes > New Index in Object Explorer),

alt text

it's totally visible and usable....

alt text

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
0

Do you see it when you run this query?:

select * 
from sys.indexes
where object_name(object_id) = 'ClientSocialTypes'
James Wiseman
  • 29,946
  • 17
  • 95
  • 158
  • 1
    I found the problem. I have to close the diagram and re-open it. It doesn't "refresh" on its own. – IamIC Nov 15 '10 at 14:43