DECLARE @reset_id varchar(200)
DECLARE reset_cursor CURSOR FOR
select Table_schema+'.'+Table_Name as tname from information_schema.tables
where Table_Type='BASE TABLE'
OPEN reset_cursor;
FETCH NEXT FROM reset_cursor
INTO @reset_id;
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC CHECKIDENT(@reset_id,RESEED,0)
print @reset_id;
FETCH NEXT FROM reset_cursor INTO @reset_id;
END;
CLOSE reset_cursor;
DEALLOCATE reset_cursor;
No comments:
Post a Comment