locked
Is there a way to add a Database Property? RRS feed

  • Question

  • I got to thinking how nice it would be if there was a way to add a new Database Property that was just a simple text field with a 'friendly' description of the database. Is there any way to add this?
    Monday, December 4, 2006 9:35 PM

Answers

  • Hi Sandy,

    Yes, you certainly can.  Have a look for "Extended properties" in BOL.  Otherwise, you can add extended properties via SSMS under database properties.  Extended properties can also be bound to individual columns or tables.

    So, to add a property to YourDatabase you would:

    USE YourDatabase
    GO

    EXEC sp_addextendedproperty @name = 'DBDescription', @value = 'DescriptionHere'

    Cheers,

    Rob

    Monday, December 4, 2006 9:54 PM

All replies

  • Hi Sandy,

    Yes, you certainly can.  Have a look for "Extended properties" in BOL.  Otherwise, you can add extended properties via SSMS under database properties.  Extended properties can also be bound to individual columns or tables.

    So, to add a property to YourDatabase you would:

    USE YourDatabase
    GO

    EXEC sp_addextendedproperty @name = 'DBDescription', @value = 'DescriptionHere'

    Cheers,

    Rob

    Monday, December 4, 2006 9:54 PM
  • Thanks for the tip! This will work perfect!
    Monday, December 4, 2006 11:57 PM