Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
joldham
Wiseass Yak Posting Master
300 Posts |
Posted - 2002-03-27 : 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. ([url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14305[/url]) 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)GOCREATE VIEW OBJECT_DESCRIPTIONS_VUasSELECT a.name, b.objectid, b.object_description, b.datemodified, user_name(b.modified_by) Modified_byfrom dbo.sysobjects a, sysobjdesc bWHERE a.id = b.objectidGOCreate Procedure usp_insert_object_desc@objname varchar(255),@objdesc varchar(4000)ASDECLARE @objid intSELECT @objid = idFROM dbo.sysobjectsWHERE name = @objnameINSERT INTO sysobjdesc VALUES (@objid, @objdesc, getdate(), user_id(system_USER))GoJeremy |
|
|
|
|
|
|