I am using Entity Developer 5.5 with EF 5 and an Azure MS SQL database. SQL Server/Azure is set in the model properties as the target server/version.
I want to use GUIDs as a primary key, and the keys should be generated by the database. However, when doing this, Entity Developer generates SQL statements with the function "newsequentialid()". This function is not supported on Azure.
How can I tell Entity Developer to use the "newid()" function, which is supported?
Store generated Guid as key does not work on Azure
-
- Posts: 21
- Joined: Tue 07 Jan 2014 12:38
Re: Store generated Guid as key does not work on Azure
Which template are you using?
Try setting the Store Generated Pattern property for that column in Entity Developer to Identity and over in sql server management studio set a default value for that column of newid()
Sql Server Management Studio:
Entity Developer:
Try setting the Store Generated Pattern property for that column in Entity Developer to Identity and over in sql server management studio set a default value for that column of newid()
Sql Server Management Studio:
Entity Developer:
Re: Store generated Guid as key does not work on Azure
We have reproduced the issue: if Model Settings > Synchronization > Mapping > Server Version is set to Azure, the Generate Database Script and Update To Database wizards of Entity Developer generate "DEFAULT NEWSEQUENTIALID()" for the property with Nullable=False, Store Generated Pattern=Identity, Type=Guid (in SSDL: Type=uniqueidentifier). We will notify you when the problem is fixed.
As a temporary workaround, please set Default Value=newid() for the storage column explicitly in the Store (SSDL) part of the model. Entity Developer allows to modify the Storage part of the model in design time: you can navigate to the storage column in Model Explorer OR select entity property > right click > Select Storage Object.
As a temporary workaround, please set Default Value=newid() for the storage column explicitly in the Store (SSDL) part of the model. Entity Developer allows to modify the Storage part of the model in design time: you can navigate to the storage column in Model Explorer OR select entity property > right click > Select Storage Object.
Re: Store generated Guid as key does not work on Azure
The bug with generating NEWID() by Generate Database Script/Update Database From Model wizards for non-nullable Guid Identity property when 'Server Version=Azure' is fixed. We will notify you when the corresponding build of Entity Developer is available for download.
Re: Store generated Guid as key does not work on Azure
New build of Entity Developer 5.7.286 is available for download!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=28822.
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=28822.