开发者

Setting the seed value for an identity column in visual studio/entity framework w/SQL Server 2008R2

Is it possible to override the seed value when creating a new table using the designer in visual studio?

I know it does not really matter from a programmatic point of view, but I don't like when ID's start at 1. I don't want to see customer ID of '1' or a sales order of 3 - I prefer them to all be the same length - i.e. 4 or 5 or 6 digits long, so depending on the estimate size of the data I always use 1,000, 10,000 or 100,000 as the starting seed value.

I know I can do it in SQL management studio, but even when I do set the seed to 1,000 or 10,000, if I refresh the EDMX from the database it reverts back to IDENTITY(1,1) and I don't want to have to do this for dozens of table开发者_如何学Cs everytime I recreate the model. I can't find anything in the property window that would allow me to override this behavior.

Thanks.


The Entity Designer Database Generation Power Pack will allow you to update a DB schema without recreating the DB from scratch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜