3

Is it possible to create database files that are independent from any SQL Server engine on the fly? The thing is that we want to create one database file per user in our application, and we want that database to be stored in the user's directory but we don't want to connect to it through SQL Server. Prety much like an sdf file, but instead of App specific, User specific.

So what we want to do is that every time a user is created in the app, generate their folder, and generate the database schema, which will be populated later.

4 Answers 4

3

Sounds like you're looking for SQL Server Compact. You can create any number of these databases at runtime and place them anywhere you want.

Sign up to request clarification or add additional context in comments.

Comments

2

Sounds like you really want a combo of "Access" and the Jet engine. It meets the database in a single file requirement and is reasonably performant for single user access.

Another possibility would sqlite, which is IMHO a better database but support for C# seems immature.

Comments

1

You can also have empty database file stored and each time a new user is created make a copy of that empty database file into the user folder. This way the schema will be there from the empty database file (it is like a template or a model database from the SQL Server).

1 Comment

I used this approach. It's the easiest. Thanks!
0

SQL Server Express/Compact with smo to programatically create your db.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.