Note that there are some explanatory texts on larger screens.

plurals
  1. POStored procedure passing parameter MAX size Limite
    primarykey
    data
    text
    <p>I'm Using Microsoft SQL server 2005</p> <p>I Created stored procedure for generate the report.</p> <p>ASP.NET from is used for passing parameter for the stored procedure.</p> <p>Problem is it's not taking All the PartNumber what selected for parameter. It's taking ONLY 225 PartNumber and generate report for only those partNumber but in real I have more than 700 PartNumber.</p> <h2>IS there any other way where I can extend the size for parameter.?</h2> <h2>Is there more size limit in sql server 2008.?</h2> <h2>Is there any way to store this "@sqlQuery nvarchar(4000)" variable to XML variable.?</h2> <p>4000 is the max Size for nvarchar (because I tried to extend it and it's not accept more than 4000). Xml variable has no limit.</p> <h2>Example for Parameter values (Passed From ASP.NET )</h2> <pre><code>PartNumber 314013 314039 314047 314054 314062 314070 314088 314096 314104 314344 314351 314377 314393 </code></pre> <h2>Stored procedure</h2> <pre><code>USE [Reportbox] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[spCreateReport2] (@prod nvarchar(4000)) AS BEGIN DECLARE @sqlQuery nvarchar(4000) declare @intMonth nvarchar(2) declare @intMonth1 nvarchar(2) declare @intMonth2 nvarchar(2) declare @intMonth3 nvarchar(2) declare @intMonth4 nvarchar(2) declare @intMonth5 nvarchar(2) SELECT @intMonth = fiscalmonth FROM FiscalWeeks WHERE CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) between weekstart and weekend if @intmonth-1&lt;=0 BEGIN set @intmonth1=@intmonth-1+12 END else set @intMonth1=@intMonth-1 if @intmonth-2&lt;=0 BEGIN set @intmonth2=@intmonth-2+12 END else set @intmonth2=@intmonth-2 if @intmonth-3&lt;=0 BEGIN set @intmonth3=@intmonth-3+12 END else set @intmonth3=@intmonth-3 if @intmonth-4&lt;=0 BEGIN set @intmonth4=@intmonth-4+12 END else set @intmonth4=@intmonth-4 if @intmonth-5&lt;=0 BEGIN set @intmonth5=@intmonth-5+12 END else set @intmonth5=@intmonth-5 Set @sqlQuery = 'select distinct d.PROD80, DESC80, SUM_AVGU80, AVGU80, SUM_ONHA80, d.ONHA80, SUM_SAFE80, d.SAFE80, MAX_FOQT80, MAX_ABCC80, MAX_MINQ80, SUM_WEEK_NO_PO, SUM_TRIG80, d.TRIG80, SUM_BQTY80, DQTY80, OQTY80, CASE WHEN d.AVGU80&lt;&gt;0 THEN CAST(ROUND(d.ONHA80/d.AVGU80,0) AS INT) ELSE 0 END AS WKS30 FROM DI80ACT00 d INNER JOIN vwDataAtCompanyLevel v on (d.prod80=v.prod80) LEFT OUTER JOIN DI80ACT01 t on (d.prod80=t.prod80) and t.ware80 &lt;&gt; ''30'' WHERE d.prod80 in (' + @prod + ') and d.prod80&lt;&gt;''HLW54B'' and d.ware80=''30'' GROUP BY d.PROD80, DESC80, SUM_AVGU80, AVGU80, SUM_ONHA80, d.ONHA80, SUM_SAFE80, d.SAFE80, MAX_FOQT80, MAX_ABCC80, MAX_MINQ80,SUM_HSTA80,SUM_HSTB80,SUM_HSTC80,SUM_HSTD80,SUM_HSTE80,SUM_HSTF80,SUM_POOR80,POOR80,SUM_TWIN80,SUM_WEEK_No_PO,SUM_TRIG80,TRIG80,SUM_BQTY80,DQTY80,OQTY80' exec(@sqlQuery) END </code></pre> <p>Any Help Or details will be very helpful Thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload