Question

Does MS SQL Server Express save one database per file (like SQLite, which I cannot use)?

I am asking because I want the users of my app to be able to easily exchange databases. So, several files would make the whole procedure too hard, which is why I would use another DB then.

Était-ce utile?

La solution

SQL Express uses 2 files per database one with the extension MDF and another with the extension LDF. You'll need both for your database to work. I have never tried to copy the files from one machine to another. I normally backup the files from one machine and restore to another machine and overwrite a db that already exists.

That said it looks like you might be able to copy the files from machine A to machine B and then on machine B, with SQL manager Connect to the SQL Server (localhost or whatever) Right click Databases folder Left click Attach, Add Point to the MDF you want to start using and you should be good to go.

Autres conseils

SQL Server Express software is not in 1 file. However you could have the database data in a file. You may want to consider SQL Server CE. SQL CE databases reside in a single .sdf file which can be up to 4 GB in size. See more here: WIKI-Expres-CE.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top