Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
?-- =============================================
-- Description: Returns the MS_Descriptions of fields in the database.
-- See http://databases.aspfaq.com/schema-tutorials/schema-how-do-i-show-the-description-property-of-a-column.html
--
-- Maintenance Log:
--
-- Update By Update Date Description
-- ----------- --------- ----------------------------
-- =============================================
CREATE PROCEDURE [dbo].[uspRptDetDataDictionary]
@tableIds varchar (MAX)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
BEGIN TRY
SELECT
c.object_id,
[Table Name] = OBJECT_NAME(c.object_id),
[Column Name] = c.name,
[Description] = ex.value
FROM
sys.columns c
LEFT OUTER JOIN
sys.extended_properties ex
ON
ex.major_id = c.object_id
AND ex.minor_id = c.column_id
AND ex.name = 'MS_Description'
WHERE
OBJECTPROPERTY(c.object_id, 'IsMsShipped') = 0
AND OBJECT_NAME(c.object_id) NOT LIKE '!_%' ESCAPE '!'
AND OBJECT_NAME(c.object_id) NOT LIKE 'ufn%'
AND (ISNULL(c.object_id, 0) In(SELECT [Value] FROM ufnSplit(',', @tableIds)) OR @tableIds IS NULL)
ORDER
BY OBJECT_NAME(c.object_id), c.column_id;
END TRY
BEGIN CATCH
PRINT 'There was an error getting the meta data dictionary' + CHAR(13);
SELECT * FROM dbo.ufnGetErrorInfo();
EXEC uspRaiseErrorInfo;
END CATCH
END