ALTER PROCEDURE [dbo].[get_View_SAP_Data_Grid1] @param3 nvarchar(100) ,@param4 nvarchar(100) ,@param5 nvarchar(100)
AS
set nocount on
declare @sql nvarchar(max)
set @SQN = N'
SELECT dbo.SapData.MFRNUM, dbo.SapData.MFRNAME, dbo.SapData.WWGDESC, dbo.SapData.ITEM, dbo.SapData.XREF, dbo.SapData.SPIN,
dbo.SapData.REDBOOKNUM, dbo.SapData.WWGMFRNAME, dbo.SapData.WWGMFRNUM, WwgExtra.dbo.SapAltData.ALT1,
WwgExtra.dbo.SapAltData.ALT1SPIN, dbo.SapData.RICHTEXT, dbo.SapData.COMMENTS, WwgExtra.dbo.SapAltData.ALT1DESC,
WwgExtra.dbo.SapAltData.ALT1DESC2, WwgExtra.dbo.WwgExtra.GREEN, WwgExtra.dbo.WwgExtra.SEGMENT,
WwgExtra.dbo.WwgExtra.PRIVATE_LABEL
FROM dbo.SapData INNER JOIN
WwgExtra.dbo.WwgExtra ON dbo.SapData.ITEM = WwgExtra.dbo.WwgExtra.ITEM INNER JOIN
WwgExtra.dbo.SapAltData ON WwgExtra.dbo.WwgExtra.ITEM = WwgExtra.dbo.SapAltData.ITEM
WHERE SapData.MFRNUM LIKE @param3 + ''%''
order by ' + @param4 + ' , ' + @param5
exec sp_Executesql @SQL,N'@param3 nvarchar(100)',@param3=@param3
|