Beginner's SQL: How do I find a detached database?

You can always look at the database properties in your Object Explorer in SQL Server Management Studio before detaching - the file(s) will not be moved or anything when detaching....

enter image description here

In the Properties dialog box, go to the Files section and to your right, the relevant info can be found:

enter image description here


SQL Server databases are .mdf files. When you detach, the .mdf file is closed by the SQL Server process, but it exists from the moment you create the database. Just to be clear, there is no concept of "saving" in an SQL DBMS; at least, not in the sense you are suggesting. Every transaction you perform is permanently stored from the moment it is committed.

When creating the database, the dialog box shows a list of files that will be created. You may have to resize some of the columns and scroll horizontally to see the full path. You can also see this information by bringing up the database properties dialog.

The .ldf file is the transaction log. It plays a vital role in ensuring the permanency of committed transactions.