New answers tagged

2

If you want something to run on server startup you can create a stored procedure in the master database and mark it as a startup stored procedure as long as the scan for startup procs configuration option is set. No need for powershell or batch files. I have come up with one solution for which I am not sure - is it good or not? To determine whether ...


14

I don't think there's any real "internals" reason. The metadata is stored at column level not table level. It would need a rethink though of scalar functions such as scope_identity() and pseudo column syntax such as $identity as there would now be ambiguities. Philosophically if the purpose of identity is to produce something that uniquely identifies an ...


7

If you can access the DAC (Dedicated Administrator Console), you can inspect the value of the identity column, for INT columns, by looking at the idtval column in sys.syscolpars. Thanks to Martin Smith for directing me to that table via this very useful answer by Roi Gavish on a related question here. Take, for instance, the following temporary table: USE ...


6

As Paul White answered absolutely correct there is a possibility for temporarily "skipped" identity rows. Here is just a small piece of code to reproduce this case for your own. Create a database and a testtable: create database IdentityTest go use IdentityTest go create table dbo.IdentityTest (ID int identity, c1 char(10)) create clustered index ...


17

When inserting a row, is there a window of opportunity between the generation of a new Identity value and the locking of the corresponding row key in the clustered index, where an external observer could see a newer Identity value inserted by a concurrent transaction? Yes. The allocation of identity values is independent of the containing user ...



Top 50 recent answers are included