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.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/20131120/合并重量function.sql

21 lines
466 B
Transact-SQL

--drop function [F_weight]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create function [dbo].[F_weight](@Contractno varchar(50))
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+convert(varchar,convert(numeric(7,4),[weight]/1000))+' ' from import_cargo where Contractno=@Contractno
return @S
end
GO
select dbo.[F_weight]('XXH201311180014')