Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Retrieving Backup File Description.
Wed, Oct 19 2016 12:35 AMPermanent Link

Steve Gill

Avatar

I'm sure this has been asked before, and probably by me, but when I searched I couldn't find an answer to it.

The syntax for backing up a database is:

BACKUP DATABASE <Name>
AS <BackupName>
TO STORE <StoreName>
[TABLES <TableName> [,<TableName>]]
[DESCRIPTION <Description>]
[COMPRESSION <Compression>]
[INCLUDE CATALOG [ONLY]]
[EXCLUDE PUBLISHED UPDATES]

So when I backup a database I can enter a description.  How do I retrieve this description later on using SQL?

Thanks.

= Steve
Thu, Oct 20 2016 4:08 PMPermanent Link

Richard Harding

Wise Nutrition Coaching

Steve,

<<So when I backup a database I can enter a description.  How do I retrieve this description later on using SQL? >>

Information about backups is stored in the Configuration DB.  The definition of the Backups table is described in the ElevateDB SQL Reference Manual in the topic System Information.

Try something like:

SELECT Name, Description, DatabaseName
 FROM Configuration.Backups

Richard
Thu, Oct 20 2016 10:10 PMPermanent Link

Steve Gill

Avatar

<< Information about backups is stored in the Configuration DB.  The definition of the Backups table is described in the ElevateDB SQL Reference Manual in the topic System Information.

Try something like:

SELECT Name, Description, DatabaseName
 FROM Configuration.Backups
>>

Stupid me.  I had typed "FILES" instead of "BACKUPS in the SET statement.  I didn't notice it until I took another look.

  DECLARE Result CURSOR WITH RETURN FOR SQLStatement;

  EXECUTE IMMEDIATE 'SET BACKUPS STORE TO Backups';

  PREPARE SQLStatement FROM
     'SELECT *
        FROM Configuration.Backups';

  OPEN Result;

= Steve
Image