August 19, 2009 at 11:40 pm
Is there any possibility to create columns through TRIGGER?
I mean to say, if I have table name employee_register where column will be generated in the following way:
-----------------------------------------------------
EMPCODE | 8/17/2009 | 8/18/2009 | 8/19/2009 | .....
-----------------------------------------------------
EMP001 | 1 | 0 |
EMP002 | 0 | 0 |
EMP003 |
.
.
.
-----------------------------------------------------
August 20, 2009 at 7:53 am
OOPS, duplicate post. Please answer here
From BOL:
Additionally, the following Transact-SQL statements are not allowed inside the body of a DML trigger when it is used against the table or view that is the target of the triggering action.
CREATE INDEX (including CREATE SPATIAL INDEX and CREATE XML INDEX)
ALTER INDEX
DROP INDEX
DBCC DBREINDEX
ALTER PARTITION FUNCTION
DROP TABLE
ALTER TABLE when used to do the following:
Add, modify, or drop columns.
Switch partitions.
Add or drop PRIMARY KEY or UNIQUE constraints.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply