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 |
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 |
|
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 TRANSACTIONSET QUOTED_IDENTIFIER ONSET ARITHABORT ONSET NUMERIC_ROUNDABORT OFFSET CONCAT_NULL_YIELDS_NULL ONSET ANSI_NULLS ONSET ANSI_PADDING ONSET ANSI_WARNINGS ONCOMMITBEGIN TRANSACTIONGOCREATE TABLE dbo.Table_1 ( ID int NULL, dasdas nchar(10) NULL ) ON [PRIMARY]GODECLARE @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'GODECLARE @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'GOALTER TABLE dbo.Table_1 SET (LOCK_ESCALATION = TABLE)GOCOMMIT 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 modificationsBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/
|
 |
|
|
|
|
|
|