title: How to reset counter of primary key in SQL Server provided by Visual Studio in ASP.Net MVC 5 application
body: <p>For learning purpose, I am developing one web site. And I have hardly run the website 100 times, but I don't know one of the table's primary key has reached 2012 count. And no way I have inserted even 100 records in total. I am not sure how did that happen. Currently, I have just 1 records in the table but their PK is 2013. I want it to reset to 0. I DO NOT Care about records being deleted as the web site is under development.</p>
  
  <p>Below is the behavior:</p>
  
  <p>This is the VS Debugger output:</p>
  
  <p><a href="https://i.stack.imgur.com/IQGGP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IQGGP.png" alt="Visual Studio Debugger"></a></p>
  
  <p><a href="https://i.stack.imgur.com/xmknh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xmknh.png" alt="Table definition"></a></p>
  
  <p>You can clearly see I have just one record but PK is 2013</p>
  
  <p><a href="https://i.stack.imgur.com/WkK5N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WkK5N.png" alt="Notice the PK"></a></p>
  
  <p>Controller Action</p>
  
  <pre><code> [HttpPost]
          [ValidateAntiForgeryToken]
          public ActionResult Create(CoverLetter coverLetter, HttpPostedFileBase uploadedCoverLetter)
          {
              var x = User.Identity.GetUserId();
              try
              {
                  if (ModelState.IsValid)
                  {
                      if (uploadedCoverLetter != null &amp;&amp; uploadedCoverLetter.ContentLength &gt; 0)
                      {
                          var tempcoverletter = new CoverLetter
                          {
                              FileName = System.IO.Path.GetFileName(uploadedCoverLetter.FileName),
                              ContentType = uploadedCoverLetter.ContentType,
                              CoverLetterName = coverLetter.CoverLetterName,
                              CandidateId = User.Identity.GetUserId(),
                              datetime = System.DateTime.Now
                          };
                          using (var reader = new System.IO.BinaryReader(uploadedCoverLetter.InputStream))
                          {
                              tempcoverletter.Content = reader.ReadBytes(uploadedCoverLetter.ContentLength);
                          }
                          _context.CoverLetters.Add(tempcoverletter);
                      }
                      _context.SaveChanges();
                      return RedirectToAction("CoverLetterCenter");
                  }
              }
              catch (RetryLimitExceededException /* dex */)
              {
                  //Log the error (uncomment dex variable name and add a line here to write a log.
                  ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
              }
              return View("Index");
          }
  </code></pre>