However, in order to backup my local databases, I use a basic file copy method. (SyncToy and xcopy are examples of MicroSoft free/included utilities that do this)
In order to make a copy/backup of the databases I use, I first have to turn off SQL Server. This is because the basic file-copy utilities I use can't copy a file currently in use. A running instance of SQL Server automatically means there are DB files in use.
Therefore, it is necessary to kill all going SQL Server instances. This has a secondary benefit of reducing CPU overhead from the running SQL Server processes, and is useful while running the laptop on battery. Say, while writing blog posts on the couch after hours.
So, you need to kill all open processes.
The easiest way I've found to do this is
- Press windows+R to get a "Run" window
- Type "cmd" and press enter to get a command shell
- Note that you may have to gain an administrator shell to do this...
- Since I'm currently running enhanced permissions on my user account, YMMV
- Type "NET START" to get the list of all currently running processes
- Copy all SQL Server entries from the windowed results
- Alternately, you can type something like
- "NET START > C:\RUNNING_LIST.TXT"
- This will generate a text file containing all the processes you're currently running.
- No matter how you get your process list, you have to:
- Get the list into a text file
- Edit it so it doesn't contain any processes but SQL Server processes
- For each SQL Server process listed, prepend the line with "NET STOP"
NET STOP "SQL Server Analysis Services (MSSQLSERVER)"Personally, I just put this into a file named KillSQL.cmd, and I run it right before I back up my PC.
NET STOP "SQL Server Browser"
NET STOP "SQL Server Reporting Services (MSSQLSERVER)"
NET STOP "SQL Full-text Filter Daemon Launcher (BLANCO)"
NET STOP "SQL Full-text Filter Daemon Launcher (MSSQLSERVER)"
NET STOP "SQL Server (BLANCO)"
NET STOP "SQL Server (MSSQLSERVER)"
NET STOP "SQL Server (SQLEXPRESS)"
NET STOP "SQL Server VSS Writer"
Don't forget to make a file full of "NET START" commands to bring everything back to life again.