SQLTeam.com | Weblogs | Forums

Puzzling Problem


#1

I Have Created A SP And It Is As Follows

USE [Mydata17]
GO
/****** Object: StoredProcedure [dbo].[prcGetItemsDetails] Script Date: 01/09/2018 11:18:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter PROCEDURE [dbo].[prc_SpecialPrice]

(@MyItem nvarchar(15),
 @MyAccNo nvarchar(15)
 )

AS
Begin
set NOCOUNT on
select * from tblSpecialPrice Where ACNUMBER = @MyAccNo And STCODE = @MyItem
End
Return

exec prc_SpecialPrice '41113166', 'supr08'

The Avove SP Returns No Data

While

select * from tblSpecialPrice Where ACNUMBER = '41113166' And STCODE = 'SUPR08'

Returns Data

Any Solution


#2

You have the parameters switched.