nerdexam
Microsoft

70-433 · Question #93

You have a table named Person that contains a nvarchar column named Surname. The Person table currently has a clustered index on PersonID. The Surname column contains Russian and Japanese…

The correct answer is C. Create a computed column for each collation that needs to be searched. -- Add computed columns with different collations. ALTER TABLE Person ADD Surname_RU AS Surname COLLATE Cyrillic_General_CI_AS, Surname_JP AS Surname COLLATE Japanese_CI_AS_KS; -- Create an index on the computed columns. CREATE NONCLUSTERED INDEX IX_Person_Surname_RU ON Person…

Troubleshoot and Optimize Databases

Question

You have a table named Person that contains a nvarchar column named Surname. The Person table currently has a clustered index on PersonID. The Surname column contains Russian and Japanese characters. The following code segment will be used to search by Surname. IF @lang ='Russian' SELECT PersonID, Surname FROM Person WHERE Surname = @SearchName COLLATE Cyrillic_General_CI_AS if @lang = 'Japanese' SELECT PersonID, Surname FROM Person WHERE Surname = @SearchName COLLATE Japanese_CI_AS_KS You need to enable SQL Server to perform an index seek for these queries. What should you do?

Options

  • ACreate an index on the Surname column.
  • BCreate a computed column for each collation that needs to be searched.
  • CCreate a computed column for each collation that needs to be searched.
  • DCreate a new column for each collation that needs to be searched and copy

How the community answered

(36 responses)
  • A
    3% (1)
  • B
    8% (3)
  • C
    72% (26)
  • D
    17% (6)

Explanation

-- Add computed columns with different collations. ALTER TABLE Person ADD Surname_RU AS Surname COLLATE Cyrillic_General_CI_AS, Surname_JP AS Surname COLLATE Japanese_CI_AS_KS; -- Create an index on the computed columns. CREATE NONCLUSTERED INDEX IX_Person_Surname_RU ON Person (Surname_RU); CREATE NONCLUSTERED INDEX IX_Person_Surname_JP ON Person (Surname_JP);

Topics

#collation index seek#computed columns#persisted computed columns#collation expressions

Community Discussion

No community discussion yet for this question.

Full 70-433 Practice