MSSQL表名:
SELECT
-- 当前自增长字段最大值
--ident_current('TableName'),
TableName= D.name ,Impdate=GETDATE() ,lasetDate=null,isrun=0,maxkey=0
FROM sysobjects D
WHERE D.xtype='U' and D.name<>'dtproperties'
更新自增长字段 JAVA
MSSQL表结构:
SELECT
-- 当前自增长字段最大值
ident_current('TableName'),
TableName= Case When A.colorder=1 Then D.name Else '' End,
TableDesc= Case When A.colorder=1 Then isnull(F.value,'') Else '' End,
FieldNum= A.colorder,
FieldName= A.name,
FieldDesc = isnull(G.[value],''),
IsAdd= Case When COLUMNPROPERTY( A.id,A.name,'IsIdentity')=1 Then '√'Else '' End,
FieldType= B.name,
FieldBytes= A.Length,
FieldLength= COLUMNPROPERTY(A.id,A.name,'PRECISION'),
PointDigit= isnull(COLUMNPROPERTY(A.id,A.name,'Scale'),0),
IsNul = Case When A.isnullable=1 Then '√'Else '' End,
SetValue = isnull(E.Text,'')
FROM syscolumns A
Left Join systypes B On A.xusertype=B.xusertype
Inner Join sysobjects D On A.id=D.id and D.xtype='U' and D.name<>'dtproperties'
Left Join syscomments E on A.cdefault=E.id
Left Join sys.extended_properties G on A.id=G.major_id and A.colid=G.minor_id
Left Join sys.extended_properties F On D.id=F.major_id and F.minor_id=0
where d.name='Country' --如果只查询指定表,加上此条件
Order By
A.id,A.colorder