问题
How could I create a uniqueidentifier ID column and a unique nvarchar(256) email address column in SQL Azure Federation? I'm not a SQL guy, so I don't know how to set a unique constraint or if it's possible to do that in a federated database.
Edit:
I found a TSQL query to create a unique constraint, but I'm getting the following error:
"A unique or clustered index on a federated table must contain the federated column"
I think my federated column is the ID column.
回答1:
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
来源:https://stackoverflow.com/questions/12416925/create-a-table-with-a-primary-key-and-a-separate-unique-column-in-sql-azure-fede