Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

CREATE TABLE [dbo].[HPMS_CompetencyTypes](CompetencyType
varchar(50) )

go
create trigger hpms_create_Insert
on HPMS_CompetencyTypes
for insert
as
if Exists ( select * from [HPMS_CompetencyTypes] where
CompetencyType=(select * from [HPMS_CompetencyTypes]))
begin
Rollback tran
Raiserror ('duplicate value',12,6)
go
insert HPMS_CompetencyTypes (CompetencyType) values ('new')


I'm new to trigger can any one tell me where is the issue.
Please.

Answer Posted / mano karnan

pls try this now,

CREATE TABLE [dbo].[HPMS_CompetencyTypes](CompetencyType
varchar(50) )
go

create trigger hpms_create_Insert on HPMS_CompetencyTypes
for insert as
if Exists ( select * from [HPMS_CompetencyTypes] where
CompetencyType=(select * from [HPMS_CompetencyTypes]))
begin
Rollback tran
Raiserror ('duplicate value',12,6)
End
go
insert HPMS_CompetencyTypes (CompetencyType) values ('new')

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by data manipulation language?

950


what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

884


What is etl - extraction, transformation, and loading?

859


What happens when converting big values to numeric data types?

1032


Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

1266


What are data driven subscriptions?

106


How to encrypt data between dialogs?

1033


What are the restrictions that views have to follow?

913


Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?

991


What is proper subset of candidate key?

948


How to list all tables in the database using odbc_tables()?

983


Does sql server 2000 clustering support load balancing?

907


How do you create a clustered index?

1000


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

935


Explain Geometry datatype in sql server 2008 with example

921