Nilesh Avhad

Nilesh Avhad

  • NA
  • 600
  • 306.8k

one Store procedure for insert and update

Jan 12 2013 12:07 AM

I have table called CategoryMaster. Fields of the tables are as: id(int) PK, CatCode varchar(10), catdesc varchar(50).

My scenario is that Id(primary key) is identity field so that it will generate aotomatically by sql server. catcode is ganetered by me through trigger like as  e.g CG00000001,CG00000002,CG00000003,..and so on and catdesc will enter by user. Now I want to write only one  store procedure to insert if not exist else update the record based on the "catcode". What is the store procedure is for this type of scenario? plz help me?

thanks!


Answers (1)