AT :
MS-SQL'de string alanda bir karakter veya karakter grubunun kaçıncı sırada olduğunu bulmak için kullanılan UDF (User Definite Function) dir.
Kullanımı:
declare @gcString nvarchar(4000), @gcFindString nvarchar(4000)
select @gcString = 'Tüm insanlar kardeştir', @gcFindString = 'in'
select dbo.AT(@gcFindString, @gcString, default) -- dönen değer=5
Create Scripti:
CREATE function AT (@cSearchExpression nvarchar(4000), @cExpressionSearched nvarchar(4000), @nOccurrence smallint = 1 )
returns smallint
as
begin
if @nOccurrence > 0
begin
declare @i smallint, @StartingPosition smallint
select @i = 0, @StartingPosition = -1
while @StartingPosition <> 0 and @nOccurrence > @i
select @i = @i + 1, @StartingPosition = charindex(@cSearchExpression COLLATE Latin1_General_BIN, @cExpressionSearched COLLATE Latin1_General_BIN, @StartingPosition+1 )
end
else
set @StartingPosition = NULL
return @StartingPosition
end
GO
Kaydol:
Kayıt Yorumları (Atom)
BlackListIP control on Serenity platform (.NET Core)
In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...
-
In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...
-
TABLO ADI AÇIKLAMA L_PERSONEL Çalışma Alanı Tanımları L_SYSLOG Kullanıcı Kaydı İzleme L_L...
-
Microsoft OLE DB Provider for SQL Server : Cannot create a row of size 8100 which is greater than the allowable maximum of 8060. (80040E14) ...
Hiç yorum yok:
Yorum Gönder