Friday, February 24, 2012

DATABASEPROPERTYEX code?

where does DATABASEPROPERTYEX() get its information from? I cant seem to use
sp_helptext to see the code. error "DATABASEPROPERTYEX does not exist in thi
s
database". I checked every db on the server, where does it exist at?
I am tryign to wrte code that checks for recovery level without using the
DATABASEPROPERTYEX function.
thanks in advance!DATABASEPROPERTYEX() is a system function. It's coded as part of the SQL
Server engine, and the code of it not publicly available. What are you
trying to do that prevents you from using DATABASEPROPERTYEX()?
Jacco Schalkwijk
SQL Server MVP
"Carl Henthorn" <CarlHenthorn@.discussions.microsoft.com> wrote in message
news:3D552067-10AD-4023-BAD7-9145BC7A0F02@.microsoft.com...
> where does DATABASEPROPERTYEX() get its information from? I cant seem to
> use
> sp_helptext to see the code. error "DATABASEPROPERTYEX does not exist in
> this
> database". I checked every db on the server, where does it exist at?
> I am tryign to wrte code that checks for recovery level without using the
> DATABASEPROPERTYEX function.
> thanks in advance!|||Many of the properties returned by the DATABASEPROPERTYEX function can
be found in the master.dbo.sysdatabases table, in the status and
status2 columns. The recovery model is dependent on the 'select
into/bulkcopy' and 'trunc. log on chkpt.' database options. However,
it's recommended that you use the DATABASEPROPERTYEX function (instead
of reading from system tables).
Razvan