Re: Are you guys sure about '+' in this sp
From: Adam Machanic (amachanic_at_air-worldwide.nospamallowed.com)
Date: 03/24/04
- Next message: Steve Kass: "Re: PWDCOMPARE"
- Previous message: Chris: "Re: Are you guys sure about '+' in this sp"
- In reply to: Chris: "Re: Are you guys sure about '+' in this sp"
- Next in thread: Daniel P.: "Re: Are you guys sure about '+' in this sp"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 17:08:29 -0500
Chris,
You're still not evaluating that SQL; all you're doing is preparing the
string. You need to EXECUTE it.
"Chris" <anonymous@discussions.microsoft.com> wrote in message
news:A1A25FC9-8B12-4757-ADE5-C49AD3266A81@microsoft.com...
> Hi,
> This is a sample
>
>
> create procedure testing(
> @storeID varchar(10),
> @productNumber varchar(10),
> @coverDate varchar(10),
> @strSQL INT(10) OUTPUT
>
> )
> AS
>
>
>
> select @strSQL = 'SELECT sum(quantity + overage - notdeliv - short -
damaged) from OPENQUERY(PROGLINK,' + '''select
quantity,overage,notdeliv,short,damaged
> from history where id =' + (@storeID) + 'and number =' +
(@productNumber) + ' and cover-date =' + (@coverDate) + '''' + ')'
>
>
> return @strSQL
>
>
> I need the value returned to be integer. Presently Iget an error
>
> Server: Msg 2716, Level 16, State 1, Procedure testing, Line 0
> Column or parameter #4: Cannot specify a column width on data type int.
> Parameter '@strSQL' has an invalid data type.
>
- Next message: Steve Kass: "Re: PWDCOMPARE"
- Previous message: Chris: "Re: Are you guys sure about '+' in this sp"
- In reply to: Chris: "Re: Are you guys sure about '+' in this sp"
- Next in thread: Daniel P.: "Re: Are you guys sure about '+' in this sp"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|