none
Two unique columns in SQL Azure Federation

    Question

  • Assume a Users table has ID and emailAddress columns though in reality it would have more. ID is a uniqueidentifier whereas emailAddress is nvarchar(256). I need to make sure both of these columns are unique. Also, this table is in a federation member database. How could I achieve this?
    Thursday, September 13, 2012 1:49 AM

Answers

All replies

  • Unique index? or am i missing something?

    Thursday, September 13, 2012 7:29 AM
    Answerer
  • I'm getting the following error: "A unique or clustered index on a federated table must contain the federated column"

    The federated column in my table is the ID column. Does it make sense to set the email address column as the primary key and the federated column?

    Friday, September 14, 2012 1:24 AM
  • just follow what the error tells you.

    federated columns are required to be part of a unique or clustered index.

    see: Federation Guidelines and Limitations

    so, for your unique index, the columns should be Id+emailAddress

    Friday, September 14, 2012 1:48 AM
    Answerer