Solved

error in running a stored procedure in mssql

Posted on 2014-09-30
2
299 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 32

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:ScottPletcher
ScottPletcher 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.‚Äč
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

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

19 Experts available now in Live!

Get 1:1 Help Now