User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,564 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,634 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 487 | Replies: 0
Reply
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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 10:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC