User Profile
Collapse
-
code use C# tag. I solve the problem with ==>Else. Thanks for reading my post. -
Or you can use
-----------------------------
Create FUNCTION [dbo].[replace_blank]
( @input nvarchar(4000))
RETURNS nvarchar(4000) As
Begin
While 1=1
Begin
IF PATINDEX('% %',@input) = 0 BREAK
SET @input = replace(@input, ' ',' ')
End
SET @input = ltrim(rtrim(@in put))
Return @input
End
-------------------------------
-- select dbo.replace_bla nk('hello...Leave a comment:
-
Create FUNCTION [dbo].[replace_blank]
( @input nvarchar(max))
RETURNS nvarchar(4000) As
Begin
Declare @output nvarchar(4000)
SET @input = ltrim(rtrim(@in put))
SET @output = ''
While 1=1
Begin
IF PATINDEX('% %',@input) = 0 BREAK
SET @output = ltrim(rtrim(@ou tput))+' '+ltrim(rtrim(S ubString(@input ,1,CharIndex(' ',@input))))
SET @input = SubString(@inpu t,CharIndex('...Leave a comment:
-
not all code paths return a value
[code=vbnet]
using System;
using System.Data;
using System.Data.Sql Client;
using System.Data.Sql Types;
using Microsoft.SqlSe rver.Server;
using System.Collecti ons;
public partial class UserDefinedFunc tions
{
[Microsoft.SqlSe rver.Server.Sql Function(FillRo wMethodName="Ob j_Row",
IsDeterministic =true,
...
No activity results to display
Show More
Leave a comment: