RSS Forums RSS
Please support our MS SQL advertiser: Programming Forums

insert sproc problems

Join Date: Oct 2007
Posts: 1
Reputation: MSnewbie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
MSnewbie MSnewbie is offline Offline
Newbie Poster

insert sproc problems

  #1  
Nov 20th, 2007
I am trying to write my first sproc that inserts values into a table. These values will be entered by the user and stored in a variable . They will then be added to the database.

This is what I have come up with so far. I can't seem to get the syntax right. I don't know what is wrong with it. Please help. Thanks.

USE DataBase

CREATE PROC spInsertNewPet

@PetID int,
@CustID int,
@PetName varchar(20),
@BreedID int,
@Gender char(1),
@Weight decimal,
@DOB smalldatetime,
@DateFixed smalldatetime



INSERT INTO Pets(PetID, CustID, PetName, BreedID, Gender, Weight, DOB, DateFixed)
VALUES(@PetID, @CustID, @PetName, @BreedID, @Gender, @Weight, @DOB, @DateFixed)

GO
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:50 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC