You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
563 B
Transact-SQL
23 lines
563 B
Transact-SQL
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_weight_SUM]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
|
|
DROP FUNCTION [dbo].[F_weight_SUM]
|
|
GO
|
|
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
create function [dbo].[F_weight_SUM](@Contractno varchar(50))
|
|
returns numeric(18,3)
|
|
as
|
|
begin
|
|
declare @S numeric(18,3)
|
|
select @S=isnull(@S,0)+convert(numeric(18,6),[weight]) from import_cargo where Contractno=@Contractno
|
|
return @S
|
|
end
|
|
|
|
GO
|
|
|
|
|