Monday, March 19, 2012

How to use query to get sql database properties

Hi,

I'm creating a User Interface to display Sql database Properties, but I cannot find the right query to retrieved the info on database properties.

The status that I get is "ONLINE", but it should be "NORMAL".

Cannot find the right query to get the date of last database backup, last transaction log backup, and maintenance plan, etc..

Please help me [:'(]

All the backup info is stored in msdb db. Check out BOL under "Viewing Backup Information".|||

Thanks 4 d reply, but I cannot find an example code, what I found was this,

Syntax

RESTORE FILELISTONLY
FROM < backup_device >
[ WITH
[ FILE=file_number]
[ [, ] PASSWORD= {password |@.password_variable } ]
[ [, ] MEDIAPASSWORD= {mediapassword |@.mediapassword_variable } ]
[ [,] { NOUNLOAD | UNLOAD } ]
]

< backup_device > ::=
{
{'logical_backup_device_name' |@.logical_backup_device_name_var}
| { DISK | TAPE }=
{'physical_backup_device_name' |@.physical_backup_device_name_var}
}

I need an example codeSad

No comments:

Post a Comment