Sorry for my English; in our SQL Server 2014 project, we have two tables that are synchronized between a web application and Android devices (they are therefore on all mobiles).
In our databases, these two tables are identified by unique identifiers of type integer
as the primary key, but we also wanted a GUID
single column that "follows" the data from its creation.
Our table A has these columns:
A_ID int
A_guid nvarchar (50)
And DetailA table:
detailA_ID int
detailA_guid nvarchar (50)
A_guid nvarchar (50) (on mobile only)
GUID columns are used in mobile applications and in synchronization on the SQL server, the "detail" data will look for the SQL Server ID corresponding to "A_guid":
select A_ID
from A
where A_guid = detailA.A_guid
All our data has been linked between them via SQL Server credentials. Of course everything works as long as the data is few. "GUID" will soon take a little time. All our GUID columns are in the format:
DEVICE_ID-YYYMMDD- [Function NEWID ()]
Apply an index is not very effective. I thought about changing the format to correspond to :
DEVICE_ID-YYYMMDD_HIS
But I do not know if we will gain speed.