Question

I am working on project in which I have used visual c# as front end and SQL Server 2008 R2 Express for backend.

Now I know that SQL Server express database has a size limit is of 10 GB, so I have written the code for database backup when pick limit is reached and I empty the database once the backup is successful.

I want to know what will be best approach to restore the backup file so that my current applications backend (which I have emptied earlier) should not be disturb.

Is it okay if I restore the same in my current database, in that case I have question to ask does it affect my applications working, as my application is kind of real time and after every 15 min. interval stored some values in database.

Whether I need to write some other utility for seeing the old data..?

Every day around 50 MB of data is inserted into database, so it will take around 8 months to reach the pick size( as per my rough calculations). and as far as the nature of application is concern user will not going to use archive data frequently. please consider this and suggest me the approach.

thanks in advance..!!

Was it helpful?

Solution

Hope i got your question right, but consider the following suggestion for working:
one database ("Current DB") that stores the real-time data.

when it comes to a size, it is dumped (or copied mdf+ldf) to archive.
and stored with time stamps (FROM-TO).

When data is needed, the relevant mdf is attached as a new "offline" database.
(you can use a connection string to attach MDF file to an SQL Server.)
and use that connection instead of the live one.

The application can run smoothly on the On-line database.
while reading, loading etc...
is done from the temporary attached and detached database files.

Take a look at : Connection String to Connect to .MDF for how to Attach a MDF to SQL Server instance.

OTHER TIPS

If you enter the data in a whole new database server your old queries won't work on the new one. As SQL Express limit is not per database, but per database server. You could create a new SQL Express Server, link your servers and create a query with a linked server ( How to create a linked server @ msdn )

You will need to adjust your queries.

If you query your data now like this:

SELECT em.Name, em.Telefone FROM employees AS em

You need to refer the database too.

SELECT [server1\db1].dbo.em.Name, [server1\db1].dbo.em.Telefone FROM [server1\db1].dbo.employees AS em

for your current database, and

SELECT [server2\backup].dbo.em.Name, [server2\backup].dbo.em.Telefone FROM [server2\backup].dbo.em.Name

It is possible like this but I would not advise it. If you exceeded 10GB data already then you might have large tables. Each table at a linked server is copied completely to you server and could cause serious network traffic and takes quite some time to be executed.

I would think of getting the SQL Standard edition.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top