?
Solved

could n't create a stored procedure?

Posted on 2011-02-23
3
Medium Priority
?
324 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 400 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 200 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 400 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 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