Solved

error in running a stored procedure in mssql

Posted on 2014-09-30
2
326 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 33

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Star schema daily updates 2 35
removing rows from sql result set  where some column values are repeated 1 24
How can I find this data? 3 25
SQL eating up memory? 16 38
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

756 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