IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_salecart]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_salecart]
GO
create proc [dbo].[mps_g_salecart](
@cmpid int ,
@useruid int , 
@malltype nvarchar(30) 
) as
begin
set nocount on
select a.* , b.* from   mps_salecart a with(nolock) , mps_saleprds  b with(nolock)  
  where ct_cuid=@useruid and ct_spid=sp_id and sp_type=@malltype  
  order by sp_code 
set nocount off 
end