how can i lock the column in the table

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between rownum and rowid?

511


Do you know what are the ways available in sql server to execute sql statements?

547


How to create prepared statements using odbc_prepare()?

572


Tell me the phases a transaction has to undergo?

554


what is hash nonclustered index

541






What authentication modes does sql server support?

599


Explain indexes disadvantages?

555


How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?

601


What is extent? Types of extents?

594


What are the basic functions for master, msdb, model, tempdb databases?

594


Explain syntax for viewing, dropping and disabling triggers?

510


Explain syntax for viewing trigger?

544


Write query to return all rows sql?

623


How to connect of datebase with sql express.?

629


What is sql server transaction log file?

525