•
•
•
•
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
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- Many problems using ASP and Excel (ASP)
- Javascript problems with IE6 (JavaScript / DHTML / AJAX)
- Problems with C:drive (Windows NT / 2000 / XP / 2003)
- Primary IDE Problems (Storage)
- Link List Insert problems (C++)
- Fan Problems (Cases, Fans and Power Supplies)
- Motherboard problems with Windows 2000 Installation? (Motherboards, CPUs and RAM)
- Hewlett packard 656c printer problems (Windows 9x / Me)
- Hewlett packard 656c printer problems (Windows 9x / Me)
Other Threads in the MS SQL Forum
- Previous Thread: Apache Torque to connect to sql server
- Next Thread: A New Break Line in SSRS


Linear Mode