Use if all tables have identity field.

exec sp_MSforeachtable @command1 = 'DBCC CHECKIDENT(''?'', RESEED, 1)'


MSforeachtable is an undocumented, but extremely handy stored proc which executes a given command against all tables in your database.

To reseed ONLY tables with an identity column you can use the next script.
It also makes use of sp_MSforeachtable but taking into account the correct tables.

EXEC sp_MSforeachtable '
IF (SELECT COUNT(1) 
    FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_TYPE = ''BASE TABLE'' 
    AND ''[''+ TABLE_SCHEMA + ''].['' + TABLE_NAME + '']'' = ''?'' 
    AND OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), ''TableHasIdentity'') = 1) &gt; 0 
BEGIN
    DBCC CHECKIDENT (''?'', RESEED, 1)
END'


Use Following query to get Last Identity value inserted in tables in a database.

   SELECT TableName = OBJECT_NAME(OBJECT_ID) ,
       ColumnName = name ,
       OriginalSeed = seed_value ,
       Step = increment_value ,
       LastValue = last_value ,
       IsNotForReplication = is_not_for_replication
FROM sys.identity_columns


Refer this for more details

Reset any identity column to start with 1 as next value
I'm working on problem 12.4 from Katz-Lindell. The problem is as follows:


  Given a public encoding function $\newcommand{\enc}{\operatorname{enc}}\enc$ and
  a textbook RSA signature scheme where signing occurs by finding $\enc(m)$ and
  raising it to the private key $d \bmod N$, how can we demonstrate the scheme's
  insecurity for $\enc(m) = 0||m||0^{L/10}$, where $L = |N|$ and $|m| = 9L/10 - 1$
  and m is not the message of all zeroes?

