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/新协航_设计文档/数据库建表文档/20140215/函数_获取申请单号结算单号.sql

22 lines
540 B
Transact-SQL

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_DanHao]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[F_DanHao]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create function [dbo].[F_DanHao](@gid varchar(50),@word varchar(16))
returns nvarchar(200)
as
begin
declare @S nvarchar(200)
select @S=isnull(@S,'')+billno+',' from ch_fee_do where feeid=@gid and billno like @word
return @S
end
GO