Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
robycave
Starting Member
2 Posts |
Posted - 2014-03-17 : 07:05:23
|
Good afternoon. I created (into a server with IIS and SQL Server 2012 Express) a table with key field type INT and IDENTITY SPECIFICATION = YES, IDENTITY INCREMENTAL=1, IDENTITY SEED=1.When I test it from my computer client (and the asp.net application running in the computer client, but connected to the database in the Server) the autoincremental field works well. When I copy the asp.net application into the server and I run it by server address, the key filed generate a number more upper that the same application from the Client coputer. For example: from the client my key file generate the number 22, 23, 24...and so on. Form the server it generate 1045,1046 adn so on. Why? It should generate 25, 26 and so on. |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-03-17 : 08:26:24
|
The next identity value generated depends on the value of IDENT_CURRENT. For reasons that I don't have enough information to comment on, the IDENT_CURRENT in your server is different. You can find the current IDENT_CURRENT using SELECT IDENT_CURRENT('YourTableNameHere') . When you insert a new row, the value assigned to the identity column would be the next one.You may fine these pages useful:http://technet.microsoft.com/en-us/library/ms175098.aspxhttp://technet.microsoft.com/en-us/library/ms189834.aspxhttp://technet.microsoft.com/en-us/library/ms176057.aspx |
|
|
robycave
Starting Member
2 Posts |
Posted - 2014-03-18 : 05:47:21
|
Thank you very much James K. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|