What should you do?

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?

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?

A.
Create an index on the Surname column.

B.
Create a computed column for each collation that needs to be searched. Create an index on the Surname column.

C.
Create a computed column for each collation that needs to be searched. Create an index on each computed column.

D.
Create a new column for each collation that needs to be searched and copy the data from the Surname column. Create an index on each new column.



Leave a Reply 0

Your email address will not be published. Required fields are marked *