DECLARE @ID INT
SET @ID=0
SELECT @ID=MAX(增长字段名)+1 FROM [表名]
DBCC CHECKIDENT('[dbo].[表名]]', RESEED,@ID)
SET @ID=0
SELECT @ID=MAX(增长字段名)+1 FROM [表名]
DBCC CHECKIDENT('[dbo].[表名]]', RESEED,@ID)
declare @sql nvarchar(4000)
declare @table nvarchar(400)
declare CustomSend_GetContentLin cursor for select name from sysobjects where xtype='U'and name<>'dtproperties' order by name
open CustomSend_GetContentLin
FETCH NEXT FROM CustomSend_GetContentLin into @table
WHILE @@FETCH_STATUS = 0
BEGIN
set @sql='
DECLARE @ID INT
SET @ID=0
SELECT @ID=MAX(ID)+1 FROM dbo.['+@table+']
DBCC CHECKIDENT(''[dbo].['+@table+']'', RESEED,@ID) '
exec (@sql)
FETCH NEXT FROM CustomSend_GetContentLin into @table
end
CLOSE CustomSend_GetContentLin
DEALLOCATE CustomSend_GetContentLin
--select name from sysobjects where xtype='U'and name<>'dtproperties' order by name
declare @table nvarchar(400)
declare CustomSend_GetContentLin cursor for select name from sysobjects where xtype='U'and name<>'dtproperties' order by name
open CustomSend_GetContentLin
FETCH NEXT FROM CustomSend_GetContentLin into @table
WHILE @@FETCH_STATUS = 0
BEGIN
set @sql='
DECLARE @ID INT
SET @ID=0
SELECT @ID=MAX(ID)+1 FROM dbo.['+@table+']
DBCC CHECKIDENT(''[dbo].['+@table+']'', RESEED,@ID) '
exec (@sql)
FETCH NEXT FROM CustomSend_GetContentLin into @table
end
CLOSE CustomSend_GetContentLin
DEALLOCATE CustomSend_GetContentLin
--select name from sysobjects where xtype='U'and name<>'dtproperties' order by name