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.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 column Description

Author  Topic 

egemen_ates
Yak Posting Veteran

76 Posts

Posted - 2012-03-07 : 10:00:58
I want to create policy for column description,

so Db user want to creat table or alter table add column.my policy check column description,if column description is null ,you dont create table or alter table given error beacause column description is null,you enter description for columns.

thank you

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-07 : 10:19:17
Since it's added as an external property and not part of the ALTER or CREATE, I'm not sure how you can enforce that, unless you are the gatekeepr and ONLY you make the modifications



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

egemen_ates
Yak Posting Veteran

76 Posts

Posted - 2012-03-07 : 10:44:24
I understand ,maybe i create ddl trigger for database ,alter,create and drop,and check column description if @v is declare or not declare so @v is not declare maybe i can transaction rollback.
is it possible


/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.Table_1
(
ID int NULL,
dasdas nchar(10) NULL
) ON [PRIMARY]
GO
DECLARE @v sql_variant
SET @v = N''
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Table_1', N'COLUMN', N'ID'
GO
DECLARE @v sql_variant SET @v = N'dasdasd'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Table_1', N'COLUMN', N'dasdas'
GO
ALTER TABLE dbo.Table_1 SET (LOCK_ESCALATION = TABLE)
GO
COMMIT





quote:
Originally posted by X002548

Since it's added as an external property and not part of the ALTER or CREATE, I'm not sure how you can enforce that, unless you are the gatekeepr and ONLY you make the modifications



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/




Go to Top of Page
   

- Advertisement -