Monday, March 26, 2012

Optimized & fastest way of taking backup & restoring database through C# code

Hi ,
Can any one tell me the Optimized & fastest way of taking backup &
restoring my database that is in SQL Server through C# code.
Currently I am using SQLDMO .Is there any Better approach of achiving the
same?
Regards
Pankaj Jain
BACKUP/RESTORE,sp_detach_db, sp_attach_db system stored procedures.For
details please refer to the BOL
"Pankaj Jain" <pankaj@.nagarro.com> wrote in message
news:eK4YzIOTGHA.5172@.TK2MSFTNGP12.phx.gbl...
> Hi ,
> Can any one tell me the Optimized & fastest way of taking backup &
> restoring my database that is in SQL Server through C# code.
> Currently I am using SQLDMO .Is there any Better approach of achiving
> the same?
> Regards
> Pankaj Jain
>
|||With SQL Server 2005, you have SMO which is the successor of DMO, but as a managed API. But you can
also use ADO.NET and just use ExecuteNonQuery to execute the BACKUP DATABASE commands. It doesn't
matter which method you use from a perf viewpoint, they all en up in BACKUP DATABASE being executed
in the end.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pankaj Jain" <pankaj@.nagarro.com> wrote in message news:eK4YzIOTGHA.5172@.TK2MSFTNGP12.phx.gbl...
> Hi ,
> Can any one tell me the Optimized & fastest way of taking backup & restoring my database that is
> in SQL Server through C# code.
> Currently I am using SQLDMO .Is there any Better approach of achiving the same?
> Regards
> Pankaj Jain
>

No comments:

Post a Comment