|
joldham
Wiseass Yak Posting Master
USA
300 Posts |
Posted - 03/27/2002 : 12:21:48
|
Below is a script to create a table, view and sp to allow you to use sysobjects to assign a description to your objects. See the following post for other suggestions to accomplish the same. ( http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14305) I will eventually add code to delete the entry in the sysobjdesc table when an object is deleted from the sysobjects table.
Please let me know if you have any comments or suggestions.
CREATE TABLE sysobjdesc (id int IDENTITY(1,1), objectid int, object_description varchar(4000), datemodified datetime, modified_by int) GO
CREATE VIEW OBJECT_DESCRIPTIONS_VU as SELECT a.name, b.objectid, b.object_description, b.datemodified, user_name(b.modified_by) Modified_by from dbo.sysobjects a, sysobjdesc b WHERE a.id = b.objectid GO
Create Procedure usp_insert_object_desc @objname varchar(255), @objdesc varchar(4000) AS DECLARE @objid int SELECT @objid = id FROM dbo.sysobjects WHERE name = @objname
INSERT INTO sysobjdesc VALUES (@objid, @objdesc, getdate(), user_id(system_USER)) Go
Jeremy
|
|