Sql-server – SQL Server 2014 – Reset everything

sql serversql server 2014

Short of reinstalling the software, is there a simple way to 'start from scratch' with a SQL instance? By that I mean:

  • Remove all created logons,
  • Remove all added databases,
  • Reset system databases,
  • Remove any new configuration,
  • Reset any SQL Server Agent configuration

I can't find anything online on how to do this.

Best Answer

You should rebuild the system databases.

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [ /SAPWD= StrongPassword ] [ /SQLCOLLATION=CollationName]

This would not remove the data and log files relating to the old databases - it just removes all references to them. You would have to manually remove the files to free up the disk space.

You must also install all service packs and hotfixes again.