View Single Post
Join Date: Mar 2008
Posts: 268
Reputation: Traicey is an unknown quantity at this point 
Solved Threads: 19
Traicey's Avatar
Traicey Traicey is offline Offline
Posting Whiz in Training

Re: Add or Update stored procedure

 
0
  #4
Dec 3rd, 2008
Well on that case you need to have an else statement

  1. IF @rc IS NULL
  2. BEGIN
  3. --SET @rc = 0
  4. INSERT INTO Method VALUES (@Method, @Mdescript)
  5. SELECT @@IDENTITY
  6. END
  7. ELSE
  8. UPDATE YOUR RECORD
  9. SELECT @RC
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote