这里是普通文章模块栏目内容页
查询有自增长列的表及目前自增长值
Select  Object_Name(id.object_id) As [table_name]
    , id.name As [column_name]
    , t.name As [data_type]
	,seed_value
	,increment_value
    , Cast(id.last_value As bigint) As [last_value]
    , Case
        When t.name = 'tinyint'   Then 255
        When t.name = 'smallint'  Then 32767
        When t.name = 'int'       Then 2147483647
        When t.name = 'bigint'    Then 9223372036854775807
        End As [max_value]
From sys.identity_columns As id
Join sys.types As t
    On id.system_type_id = t.system_type_id
Where id.last_value Is Not NULL
ORDER BY last_value DESC

上一篇: redis使用

下一篇: redis:windows连虚拟机

栏目索引
相关内容