Reputation: 33
Suppose I have multiple tables in my database having almost similar name, so in that case, is it possible to add description at table level so, when i leave my current organization, it helps other developers to understand the use of table by it description. Just like we have it in Procedures
/*==============================================
Created By : Someone
Description : To Fetch Employee Details
Created Date : 2019-12-23 16:35:55.340
==============================================*/
Upvotes: 0
Views: 813
Reputation: 1025
You can use extended properties for this, which is a feature in MS SQL Server that can be used for documentation purposes.
Here's example code on how to add a description for the Adress table in the Person schema in the AdventureWorks2012 database according to the MS documentation:
USE AdventureWorks2012;
GO
EXEC sys.sp_addextendedproperty
@name = N'MS_DescriptionExample',
@value = N'Street address information for customers, employees, and vendors.',
@level0type = N'SCHEMA', @level0name = 'Person',
@level1type = N'TABLE', @level1name = 'Address';
GO
Upvotes: 2