Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Is it safe to use IDENT_CURRENT to assign default value in Default constrain

$
0
0

Hi All,

I'm using IDENT_CURRENT('dbo.sometable') as default value.

The intension is to duplicate last identity generated for this table in the column of the same table (to form ParentId column in hierarchy) if passed value for the parentId is null.

It works, but is it safe?

Because it is NOT session scoped, is it possible IDENT_CURRENT sometime return identity from another table or from another insert in the same table when used in Default constrain?

Thank you in advance,

/Boris


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>