function

上一篇 / 下一篇  2007-06-05 13:59:57 / 个人分类:DataBase

-- ================================================
-- Template generated from Template Explorer using:
-- Create Scalar Function (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  <Author,,Name>
-- Create date: <Create Date, ,>
-- Descrīption: <Descrīption, ,>
-- =============================================
CREATE FUNCTION formatEmpty
(
@pValue varchar(200)
)
RETURNS varchar(200)
AS
BEGIN

 DECLARE @pReturn varchar(200);
 DECLARE @i int;
 DECLARE @len int;

 SET @pReturn=RTRIM(@pValue);
 SET @len=Len(@pReturn);
 SET @i=1;
 while  @i<=@len
  if (Substring(@pReturn,@i,1)='?')
    SET @i=@i+1;
  ELSE IF( Substring(@pReturn,@i,2)='?')
    SET @i=@i+2;
  ELSE
   return @pReturn;

 return '';

END
GO

 


TAG: DataBase

 

评分:0

我来说两句

日历

« 2024-04-23  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 13696
  • 日志数: 23
  • 建立时间: 2007-05-12
  • 更新时间: 2007-06-18

RSS订阅

Open Toolbar