Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Script to simplify maintenance of sysproperties

By Paul Hunter-411137,

This procedure will maintain the sysproperties table by wrapping system procedures:
                • sp_addextendedproperty
                • sp_dropextendedproperty
                • sp_updateextendedproperty
            The parameters are:
                • @object    --    primary name of the object being to be maintained.
                • @column    --    column or parameter name [optional].
                • @property    --    name of the property.
                • @value    --    description associated with the property.
                • @action    --    save or delete.

Usage  :    exec sp__SysProperties_sav 'FK_ForeignKey', null, 'MS_Description', 'this is a foreign key', ['save']
-- add a property to a parameter
sp__SysProperties_sav 'my_proc', '@some_param', 'MS_Description', 'this documents a parameter', ['save']
-- removed the property
sp__SysProperties_sav 'my_proc', '@some_param', 'MS_Description', null, 'delete'

I haven't figured out indexes or user types --- yet.

Total article views: 413 | Views in the last 30 days: 4
 
Related Articles
SCRIPT

Script to simplify maintenance of sysproperties

This procedure will maintain the sysproperties table by wrapping system procedures:                ...

FORUM

Sysproperties table

Does anyone have any documentation for the sysproperties table? It doesn't appear to be mentioned in...

FORUM

Extended property Description

How can I retrieve the values for the Description Property for a tables columns? I mean with a T-sq...

FORUM

SQLDMO Column Description property

sqldmo doesn't seem to expose the DESCRIPTION property of a column. note: this can be edited in SQL...

FORUM

Accessing the Description property of a field

In Enterprise Manager, in table design, you can enter a Description. Does anyone know a query that ...

Tags
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones