Solved

could n't create a stored procedure?

Posted on 2011-02-23
3
311 Views
Last Modified: 2012-05-11
is any thing wrong with this procedure?It is giving lot of errors


 CREATE PROCEDURE [dbo].sp_item  
         
@iitemid int  
@item varchar(20)  
@quantity decimal(10,2)  
 
BEGIN  
         
        insert into items(itemid,item,quantity)values(@iitemid,@item,@quantity)  
END  
GO
0
Comment
Question by:lucky20
3 Comments
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 100 total points
ID: 34964762
Modify to

CREATE PROCEDURE [dbo].sp_item  
 (        
@iitemid int,  
@item varchar(20),  
@quantity decimal(10,2)  
 )
 AS
BEGIN  
         
        insert into items(itemid,item,quantity)values(@iitemid,@item,@quantity)  
END
0
 
LVL 26

Assisted Solution

by:tigin44
tigin44 earned 50 total points
ID: 34964769


 CREATE PROCEDURE [dbo].sp_item  
         
@iitemid int,
@item varchar(20),  
@quantity decimal(10,2)
as
 
BEGIN  
         
        insert into items(itemid,item,quantity)values(@iitemid,@item,@quantity)  
END  
GO
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 100 total points
ID: 34964774
You need brackets round the parameters and a comma after each one other than the last. Nees the AS keyword, don't really need the begin and end. try :

 CREATE PROCEDURE [dbo].sp_item  
(          
@iitemid int,  
@item varchar(20),  
@quantity decimal(10,2)  
)  
AS  
        insert into items(itemid,item,quantity)values(@iitemid,@item,@quantity)  
GO
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now