Saturday, February 25, 2012

.Net <-> SqlServer admin actions

Hi,
Is it possible in a programmatic way (.Net) to tell the SqlServer 2000 to do
the following things?
1.. Backup the transaction protocol
2.. Restore a database backup
3.. Run the actions from the transaction protocol
This scenario is useful for me to get the database state in case of an error
(application error and not SQL or hardware error) so that I can reproduce
and correct the error.
Any answer could help me a lot.
Sincerely,
George.Hi
Yes, there are T-SQL commands as BACKUP LOG ,RESTORE DATABASE ,BACKUP
DATABASE for more details please refer to the BOL. Personally , I prefer
calling a stored procedure from .NET for instance that does such jobs .

> 3.. Run the actions from the transaction protocol
What do you mean?
"George Homorozeanu" <george_homorozeanu@.hotmail.com> wrote in message
news:OpyWjCtOGHA.312@.TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Is it possible in a programmatic way (.Net) to tell the SqlServer 2000 to
> do the following things?
>
> 1.. Backup the transaction protocol
> 2.. Restore a database backup
> 3.. Run the actions from the transaction protocol
>
> This scenario is useful for me to get the database state in case of an
> error (application error and not SQL or hardware error) so that I can
> reproduce and correct the error.
>
> Any answer could help me a lot.
>
> Sincerely,
> George.
>|||Hi,
With point 3 I wanted to say that after restoring the DB I have to restore
the transaction protocol in order to get the db state for which the error
occurred.
George.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eMGDSFtOGHA.4052@.TK2MSFTNGP15.phx.gbl...
> Hi
> Yes, there are T-SQL commands as BACKUP LOG ,RESTORE DATABASE ,BACKUP
> DATABASE for more details please refer to the BOL. Personally , I prefer
> calling a stored procedure from .NET for instance that does such jobs .
>
> What do you mean?
> "George Homorozeanu" <george_homorozeanu@.hotmail.com> wrote in message
> news:OpyWjCtOGHA.312@.TK2MSFTNGP12.phx.gbl...
>|||Hi
Ok, yes you can do that as well. There is an option of RESTORE LOG
DataBaseName FROM Disk
WITH RECOVERY, STOPAT = 'Jul 1, 2005 10:00 AM'
Agaim , much more details you can find in the BOL
"George Homorozeanu" <george_homorozeanu@.hotmail.com> wrote in message
news:O2u3xatOGHA.1088@.tk2msftngp13.phx.gbl...
> Hi,
> With point 3 I wanted to say that after restoring the DB I have to restore
> the transaction protocol in order to get the db state for which the error
> occurred.
>
> George.
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:eMGDSFtOGHA.4052@.TK2MSFTNGP15.phx.gbl...
>|||Thanks Uri,
Your answer helps me a lot. I will try to implement these things.
George.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ua9GzgtOGHA.516@.TK2MSFTNGP15.phx.gbl...
> Hi
> Ok, yes you can do that as well. There is an option of RESTORE LOG
> DataBaseName FROM Disk
> WITH RECOVERY, STOPAT = 'Jul 1, 2005 10:00 AM'
> Agaim , much more details you can find in the BOL
>
>
> "George Homorozeanu" <george_homorozeanu@.hotmail.com> wrote in message
> news:O2u3xatOGHA.1088@.tk2msftngp13.phx.gbl...
>

No comments:

Post a Comment