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.
45 lines
1.1 KiB
MySQL
45 lines
1.1 KiB
MySQL
2 years ago
|
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_Count]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
|
||
|
DROP FUNCTION [dbo].[F_Count]
|
||
|
GO
|
||
|
|
||
|
SET ANSI_NULLS ON
|
||
|
GO
|
||
|
|
||
|
SET QUOTED_IDENTIFIER ON
|
||
|
GO
|
||
|
|
||
|
|
||
|
create function [dbo].[F_Count](@Contractno varchar(50))
|
||
|
returns nvarchar(100)
|
||
|
as
|
||
|
begin
|
||
|
declare @S nvarchar(100)
|
||
|
select @S=isnull(@S,'')+convert(varchar,boxcount)+' ' from import_cargo where Contractno=@Contractno
|
||
|
return @S
|
||
|
end
|
||
|
|
||
|
GO
|
||
|
------------------------------------------------
|
||
|
|
||
|
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_Date]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
|
||
|
DROP FUNCTION [dbo].[F_Date]
|
||
|
GO
|
||
|
|
||
|
SET ANSI_NULLS ON
|
||
|
GO
|
||
|
|
||
|
SET QUOTED_IDENTIFIER ON
|
||
|
GO
|
||
|
|
||
|
create function [dbo].[F_Date](@Contractno varchar(50))
|
||
|
returns nvarchar(100)
|
||
|
as
|
||
|
begin
|
||
|
declare @S nvarchar(100)
|
||
|
select @S=isnull(@S,'')+convert(varchar,productiondate)+' ' from import_cargo where Contractno=@Contractno
|
||
|
return @S
|
||
|
end
|
||
|
GO
|
||
|
|
||
|
|