Solved

error in running a stored procedure in mssql

Posted on 2014-09-30
2
346 Views
Last Modified: 2014-09-30
USE [Testdb]
GO

DECLARE	@return_value int

EXEC	@return_value = [dbo].[TestData]
		@group = 120,
		@lang = 9,
		@langcode = 999,		
		@value = 'aaa',
		@min = 22916,
		@dec = 2,000000

SELECT	'Return Value' = @return_value

GO

Open in new window


And i end up with the following error:

Msg 119, Level 15, State 1, Line 4
Must pass parameter number 7 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'.

Open in new window


Any help?
0
Comment
Question by:jazzIIIlove
[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
2 Comments
 
LVL 34

Accepted Solution

by:
ste5an earned 250 total points
ID: 40352276
It's a wrong decimal literal, @dec must use a dot as separator:

EXEC	@return_value = [dbo].[TestData]
		@group = 120,
		@lang = 9,
		@langcode = 999,		
		@value = 'aaa',
		@min = 22916,
		@dec = 2.000000

Open in new window

0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 250 total points
ID: 40352489
Or enclose it in quotes:

@dec = '2,000000'

SQL is taking the comma there as separating input parameters, so it thinks "000000" is another parameter without a name in front of it: but, since earlier params had names in front, all subsequent params must have names in front, which is what the error is stating.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

635 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