Click here to Skip to main content
Sign Up to vote bad
good
See more: SqlServer
i have a table in that there are some columns ,now my problem is i dont want any user to delete column ,please write a trigger such that
no user will not be able to delete the columns in a table ,iam a fresher please help me
Posted 4 Jun '12 - 3:22


1 solution

Here is a Stack Overflow question that has the code you need (in the question):
 
http://stackoverflow.com/questions/1247147/how-to-make-ddl-trigger-for-a-specific-table[^]
 
Basically you create a DDL trigger at the database level that watches the ALTER_TABLE commands. Then, you use the XML EventData to look at which table is being modified and selectively block the action (unless you want to block the modification of every table in your database).
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 393
1 OriginalGriff 335
2 Arun Vasu 315
3 Maciej Los 238
4 Aarti Meswania 180
0 Sergey Alexandrovich Kryukov 9,680
1 OriginalGriff 7,539
2 CPallini 4,018
3 Rohan Leuva 3,362
4 Maciej Los 2,951


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 4 Jun 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid