Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

error in running a stored procedure in mssql

Posted on 2014-09-30
2
Medium Priority
?
377 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
2 Comments
 
LVL 36

Accepted Solution

by:
ste5an earned 1000 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 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

824 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