SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Database Object Description
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

joldham
Wiseass Yak Posting Master

USA
300 Posts

Posted - 03/27/2002 :  12:21:48  Show Profile  Reply with Quote
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

  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000