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
相关阅读:
- ASP调用存储过程(转) (overn, 2007-5-11)
- "SQL Server 不存在或访问被拒绝"解决方案 (rain_wind, 2007-5-11)
- CreateParameter 方法 (overn, 2007-5-23)
- Recordset对象方法 (overn, 2007-5-23)
- Performance Tuning SQL Server Cursors (jackz, 2007-5-28)
- DECLARE CURSOR (jackz, 2007-5-28)
- SQL优化-索引 (jackz, 2007-5-29)
- sql中distinct的用法 (jackz, 2007-5-29)
- 表Information中有四个字段:ID,Name,Sex,Position (jackz, 2007-5-29)
- 在SQL语句中使用索引提示提高SQL性能 (jackz, 2007-6-04)
收藏
举报
TAG:
DataBase