ALTER PROCEDURE [dbo].[AirWayBillsSelectByManifestNumbers] ( @awb_manifestnumber varchar(100) ) AS SET NOCOUNT ON; SELECT [awb_pk] ,[awb_keycode] ,[awb_manifestdate] ,[awb_manifestnumber] ,[awb_pieces] ,[awb_weight] ,[awb_cusfk] ,[awb_value] ,[awb_freight] ,[awb_fuel] ,[awb_insurance] ,[awb_number] ,[awb_shipper] ,[awb_description] ,[cus_number] FROM [dbo].[AirWayBills] inner join [dbo].[Customers] on awb_cusfk = cus_PK WHERE ([awb_manifestnumber] IN (@awb_manifestnumber))awb_manifestnumber is an int.
ALTER PROCEDURE [dbo].[AirWayBillsSelectByManifestNumbers] ( @awb_manifestnumber varchar(100) ) AS SET NOCOUNT ON; if object_id('tepmdb..#awblist',N'U') IS NOT NULL drop table #awblist; select int_value into #awblist from dbo.fn_ParseText2Table(@awb_manifestnumber, ',') SELECT [awb_pk] ,[awb_keycode] ,[awb_manifestdate] ,[awb_manifestnumber] ,[awb_pieces] ,[awb_weight] ,[awb_cusfk] ,[awb_value] ,[awb_freight] ,[awb_fuel] ,[awb_insurance] ,[awb_number] ,[awb_shipper] ,[awb_description] ,[cus_number] FROM [dbo].[AirWayBills] inner join [dbo].[Customers] on awb_cusfk = cus_PK inner join #awblist on #awblist.int_value = awb_manifestnumber