Port SQL Server table to SQL Azure Federation

111 Views Asked by At
CREATE TABLE MyTable
(
     ID uniqueidentifier NOT NULL PRIMARY KEY
     Column1 nvarchar(256) NOT NULL UNIQUE,
     Column2 nvarchar(256) NOT NULL UNIQUE,
)

How could I port the following table to SQL Azure Federation without losing uniqueness validation on Column1 and Column2 or the primary key constraint on ID?

1

There are 1 best solutions below

0
On

The only possible way of doing this today, is to have a Federation Key as VARBINARY(900) (the maximum allowed size for varbinary as federation key is 900 bytes).

Then, instead of having Column1 nvarchar(256) and Column2 nvarchar(256), you will have just one column - ColumnX varbinary(900).

That column will contain a binary representation of Column1 concatenated with Column2. Of course this is a bigger refactoring than expected, and you will most probably lose the possibility to directly perform searches on that column (some idea).