EWS item identifier and your database

Several times we’ve heard people ask what the maximum size is for the EWS identifier. This question usually comes up when developers are designing a database schema that will store the EWS identifier in a fixed-width column. Our answer is that the EWS item identifier should be contained in a fixed-width column of 512 characters. So, how confident should you feel about defining your field at 512 characters? Well, of course we reserve the right to change the format, and the resulting maximum length of the EWS identifier. The chances of that occurring, however, are very slim. The EWS identifier format has been changed once between Exchange 2007 and 2007 SP1, early on in the adoption of EWS, but we acknowledge that changing the format at this point would have unwelcome effects on both customer and Microsoft applications that interoperate with Exchange. In short, we do not expect the EWS identifier format to change.

Comments (4)

  1. Mitchell says:

    Is there any documentation on the format of the EWSID? It appears that the EWSID for folders and the messages contained in those folders are very similar.. Our application is storing folder EWSID’s and EmailMessage EWSID’s and if the fields are related we can compress the data.. Thanks in Advance!!

    1. No, how they’re built isn’t documented. They are intended to be opaque to EWS apps.

  2. Ted Elliott says:

    Would a varchar(512) be acceptable or does it need to be nvarchar?

  3. wes says:

    Documentation here (https://msdn.microsoft.com/en-us/library/office/dn605828(v=exchg.150).aspx#bk_WorkingWithIdentifiers) 512 bytes but you say here 512 characters. Do you know if varchar(512) is sufficient? If I use nvarchar(512) sql server tells me the column is too big to index.

Skip to main content