[thelist] sp Problem

Stevenson Ngila Stevenson at epr.footman-walker.com
Tue Oct 8 05:39:02 CDT 2002


I have an sp below :::::

ALTER  procedure sp_GetFixedIssues @iSite nvarchar(4000), at iFWApplication
int, at sPreviousBuild nvarchar(4000), at iToBuild int, at sLaterBuild nvarchar(4000)
AS
declare @sString nvarchar(4000)

if len(@sLaterBuild)> 0 begin

	set @sString = 'SELECT *
	FROM SupportCall
	WHERE scStatus = 1
	AND scSite LIKE ''%' + @iSite + '%''
	AND scFWApplication = '+ cast(@iFWApplication as nvarchar(10)) +'
	AND scID IN
	(
		SELECT sciSCID
		FROM SupportCallIncident
		WHERE cast(sciBuildNo as varchar) IN (' +  @sPreviousBuild +'  )
	)
	AND scID IN
	(
		SELECT schSCID
		FROM SupportCallHistory
		WHERE schStatus = 2
		AND cast(schBID as varchar) IN ( ' + @iToBuild + ',' + @sLaterBuild + ')
	)
	ORDER BY scID'
end
execute sp_executesql @sString

:::::::::::::::::::::::::

when i test it using :::::

""sp_GetFixedIssues
'60',1,'236,10,100,101,102,103,104,105,106,107,108,11,110,111,119,12,125,126
,127,128,129,13,130,131,132,133,134,135,136,137,138,139,14,140,141,142,143,1
44,145,146,148,149,15,150,151,152,153,154,155,156,157,159,16,160,161,162,164
,165,166,167,168,169,17,170,171,172,173,174,175,176,177,178,179,18,180,184,1
85,186,187,188,189,19,190,191,192,193,196,197,198,2,20,201,202,203,204,205,2
06,209,21,210,212,213,214,215,216,217,218,219,22,220,221,222,224,225,226,227
,229,23,230,231,232,233,234,235,237,238,239,24,240,242,247,25,250,258,259,26
,260,266,267,269,27,270,273,274,275,28,280,281,282,283,288,289,29,290,291,29
2,293,294,299,3,30,300,301,302,303,306,308,309,31,310,311,312,313,315,316,31
8,319,32,320,321,322,328,329,33,332,333,336,337,338,34,340,341,342,343,344,3
45,35,351,352,353,354,36,360,362,363,368,369,37,371,372,377,378,38,380,381,3
82,389,39,390,4,40,400,401,406,408,409,41,410,411,413,414,42,420,43,44,45,46
,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,61,62,63,64,65,66,67,68,69,7,
71,72,73,75,76,77,78,79,8,80,81,82,83,84,85,86,87,88,89,9,90,91,92,93,94,96,
97,98,99',356,'208,228,241,243,244,245,246,248,249,251,252,253,254,255,256,2
57,261,262,263,264,265,268,272,276,277,278,279,284,285,286,295,298,304,307,3
14,317,323,324,325,326,327,331,334,335,339,346,356,357,358,359,361,364,365,3
66,367,370,373,374,375,383,384,386,403'""

::::::::::::::::::::::::::::::::::

I get an error ::::::

Server: Msg 245, Level 16, State 1, Procedure sp_GetFixedIssues, Line 6
Syntax error converting the nvarchar value 'SELECT *
	FROM SupportCall
	WHERE scStatus = 1
	AND scSite LIKE '%60%'
	AND scFWApplication = 1
	AND scID IN
	(
		SELECT sciSCID
		FROM SupportCallIncident
		WHERE cast(sciBuildNo as varchar) IN
(236,10,100,101,102,103,104,105,106,107,108,11,110,111,119,12,125,126,127,12
8,129,13,130,131,132,133,134,135,136,137,138,139,14,140,141,142,143,144,...

:::::::::::::::::::::::::::::::::


Please assist

Thanks,
Stevenson Ngila
Footman-Walker Associates Ltd
http://www.footman-walker.co.uk





More information about the thelist mailing list