All pastes #201507 Raw Edit

Someone

public text v1 · immutable
#201507 ·published 2006-10-13 21:29 UTC
rendered paste body
create procedure sp_insertPricing
(
	@idPhoto int = null ,
	@idBatch int = null ,
	@name varchar(150) = null ,
	@size varchar(150) ,
	@price float ,
	@resin_price float = null ,
	@description varchar(500) = null ,
	@make_offer bit = null ,
	@offer_limit float = null ,
	@is_active bit = null ,
	@in_stock bit = null
)
as
set nocount on
begin

	if ( @idPhoto is null and @idBatch is null )
	begin
	
		raiserror 50001 'Invalid Parameters.'
		return
		
	end
	
	if ( @make_offer is null )
		set @make_offer = 0
	
	if ( @is_active is null )
		set @is_active = 0
	
	if ( @in_stock is null )
		set @in_stock = 0
	
	insert into _pricing ( idPhoto , idBatch , name , [size] , price , resin_price , description , make_offer , offer_limit , is_active , in_stock )
			values ( @idPhoto , @idBatch , @name , @size , @price , @resin_price , @description , @make_offer , @offer_limit , @is_active , @in_stock )
	
	return @@identity

end

go