how can i lock the column in the table

Answers were Sorted based on User's Feedback



how can i lock the column in the table..

Answer / arunkumar2visit

create trigger trigger_name
on tablename
for update
as
if update(col_name)
begin
raiseerror('cannot update column name',16,1)
rollback trac
end

Is This Answer Correct ?    29 Yes 2 No

how can i lock the column in the table..

Answer / prasad237

create trigger trigger_name1
on emp
for update
as
begin
if update(ename)
begin
begin tran
raiserror('cannot update column name',16,1)
rollback tran
end
else
print 'table updated'

end

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

How many columns can exist together per table?

0 Answers   Cap Gemini,


What type of locking occurs during the snapshot generation? : sql server replication

0 Answers  


you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration

0 Answers  


What are the common performance issues in sql server?

0 Answers  


How adventureworkslt tables are related?

0 Answers  






How to list all field names in the result set using mssql_field_name()?

0 Answers  


What is the use of SCOPE_IDENTITY() function?

2 Answers  


Why use “in” clause in sql server?

0 Answers  


What is subquery in sql?

0 Answers  


what is package configuration variable?How to change file name in folder dynamically?Plz help me

1 Answers  


what is the difference between delete table and truncate table commands? : Sql server database administration

0 Answers  


Does sql server use t sql?

0 Answers  


Categories