Question:
how i can refresh the sql server database?
hamid r
2010-04-23 11:57:56 UTC
when i save a data from for example a textbox in visual studio to my sqlserver database )
i should close the page and open it again to refresh my database
but i want to immediately use from the saved data
how i can refresh my database?
Three answers:
k
2010-04-23 17:21:53 UTC
Do you mean that you are displaying the database data (usually a gridview control) on the page and when you add/submit a value in a textbox on the same page you want it to display the new database data?



If that is the case you simply need to re-bind your data to the gridview (or other control) after the submit.
Abrar Alam
2010-04-23 12:15:42 UTC
As a DBA, we are often asked to refresh a database, which means to overwrite an existing database using a different database's backup. If you are rarely asked to do this, you may decide to do it manually. If you are asked to do this on a regular and perhaps scheduled basis, then you'd want to automate it. Developers often want to write and debug code against a copy of the production database, so it makes sense to refresh their databases on a daily or weekly basis.



If you were to do the refresh manually, you would probably follow these steps more or less:



Copy the backup file

Restore the database

Unorphan the accounts if the SIDs aren't in sync

Provide db_owner or similar permissions to the development staff

Run a script for anything else not handled above



Here's how I have the refresh automated in a couple of my environments:



On Server1, a job exists that compresses the latest full backup

On Server2, there's a job that performs the following steps:

Copies the compressed file to a local drive

Decompresses the file to make the full backup available

Kills all sessions to the database that is about to be restored

Restores the database

Sets the recovery model to Simple

Grants db_owner privileges to the developers
TheMadProfessor
2010-04-23 12:27:14 UTC
If a form object is bound to the database table(s), it should update the data displayed automatically whenever the underlying table data changes, afaik...that's the whole reason for binding them.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...