[dba-SQLServer] Copy a database using a store procedure orfunction

Francisco Tapia fhtapia at gmail.com
Tue Mar 25 18:21:26 CDT 2008


John,
  You "used" to write databases. and that "Used To" mean you wrote "SQL"
code.  Granted that Access SQL is nowhere in the realm of TSQL, but neither
is TSQL and VBA, even though you can practically do it all from TSQL (but
you would not want to).  BOL is a manual you "Have To" learn to use.  I say
"Have To" because as long as you plan on using Sql Server, you should plan
on making BOL and Google your best friend.  There are many things that I am
constantly learning about this engine, and I've been working on as an
Administrator for over 5 years.  You can't know everything, and it's great
that resources such as this list and the internet exists.

The term "Amazingly useful" is a subjective term.  However the kindness you
receive despite your spammer database is more "amazing useful" than I ever
thought you'd get.  I mean more power to you that you are banking in on your
knowledge of databases and explotation of people's personal information and
putting it to good use to make good $$.  In programming (not just VB) there
are many roads on how to get there.  Not all of them are bad choices, some
just make more logical sense. btw, Critizing the car because the driver
doesn't know how to drive is also useless.


--
Francisco

On Tue, Mar 25, 2008 at 2:36 PM, jwcolby <jwcolby at colbyconsulting.com>
wrote:

> Elizabeth,
>
> Thanks for the code.  I am trying it now.  I would like to make one
> comment
> though.
>
> >This is from BOL for SQL Server 2005, which is often amazingly helpful.
>
> First of all, what is you job?  What do you do?
>
> My comment is that, the instruction manual for flying a DC10 is almost
> assuredly "amazingly useful" to the right people.  If I just want to get
> to
> London by tomorrow night, it is probably about as useful as the proverbial
> "tits on a boar".  That manual and a two thousand dollars will get you a
> ticket to London.
>
> I have spent hours in BOL (really!).  It has rarely been "amazingly
> useful",
> in fact I can't say that I have EVER found it such.  But then my job is
> not
> writing SQL Server TSQL code day in and day out.  If that were my job then
> I
> am absolutely sure it would be "amazingly useful" to me.
>
> I used the "flight manual" example because when I was a teenager, I had a
> job cleaning apartments after people moved out.  I was cleaning an
> apartment
> and found the maintenance manual for an army helicopter.  While it was
> fascinating, it was also "totally useless" to me.  OTOH it was no doubt
> "amazingly useful" to the guy who left it behind.
>
> My job is not to write TSQL.  Very occasionally I am forced to do so
> because
> there are no easier to use tools but that doesn't mean that I will EVER
> know
> enough to find BOL "amazingly useful".
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
> -----Original Message-----
> From: dba-sqlserver-bounces at databaseadvisors.com
> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
> Elizabeth.J.Doering at wellsfargo.com
> Sent: Tuesday, March 25, 2008 4:10 PM
> To: dba-sqlserver at databaseadvisors.com
> Subject: Re: [dba-SQLServer] Copy a database using a store procedure
> orfunction
>
> I haven't used this (being pretty new to this myself), but I'm sure some
> one
> else here can speak to it:
>
> E. Make a copy of a database using BACKUP and RESTORE This example uses
> both
> the BACKUP and RESTORE statements to make a copy of the AdventureWorks
> database. The MOVE statement causes the data and log file to be restored
> to
> the specified locations. The RESTORE FILELISTONLY statement is used to
> determine the number and names of the files in the database being
> restored.
> The new copy of the database is named TestDB. For more information, see
> RESTORE FILELISTONLY (Transact-SQL).
>
>  Copy Code
> BACKUP DATABASE AdventureWorks
>   TO DISK = 'C:\AdventureWorks.bak'
>
> RESTORE FILELISTONLY
>   FROM DISK = 'C:\AdventureWorks.bak'
>
> RESTORE DATABASE TestDB
>   FROM DISK = 'C:\AdventureWorks.bak'
>   WITH MOVE 'AdventureWorks_Data' TO 'C:\testdb.mdf',
>   MOVE 'AdventureWorks_Log' TO 'C:\testdb.ldf'
> GO
>
> This is from BOL for SQL Server 2005, which is often amazingly helpful.
>
> HTH,
>
>
> Liz
>
>
> Liz Doering
> elizabeth.j.doering at wellsfargo.com
> 612.667.2447
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


-- 
-Francisco
http://sqlthis.blogspot.com | Tsql and More...



More information about the dba-SQLServer mailing list