123 lines
3.9 KiB
Transact-SQL
123 lines
3.9 KiB
Transact-SQL
-- Schema: C6MartPeriodico
|
|
-- Stored Procedure: CercaCaratteriAnomali
|
|
|
|
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
|
|
CREATE procedure [C6MartPeriodico].[CercaCaratteriAnomali]
|
|
AS
|
|
BEGIN
|
|
|
|
|
|
declare @num int
|
|
set @num = 1
|
|
|
|
CREATE TABLE #tab_temp(
|
|
[Val_Ascii] [smallint] NOT NULL,
|
|
[Val_Char] [varchar](1) NOT NULL,
|
|
[Rete] [varchar](1) NOT NULL,
|
|
[Cod_Fiscale] [varchar](16) NOT NULL,
|
|
[Nome_Campo] [varchar](50) NOT NULL,
|
|
[Val_Campo] [varchar](150) NOT NULL)
|
|
|
|
|
|
set @num = 1
|
|
while @num < 150
|
|
|
|
begin
|
|
insert into #tab_temp
|
|
SELECT ascii(substring(email,@num,1)),
|
|
substring(email,@num,1),
|
|
rete,
|
|
Cod_Fiscale,
|
|
'EMAIL',
|
|
email
|
|
FROM C6MartPeriodico.ContrattoSEI
|
|
WHERE
|
|
ascii(substring(email,@num,len(email))) not between 64 and 90
|
|
and ascii(substring(email,@num,len(email))) not between 97 and 122
|
|
and ascii(substring(email,@num,len(email))) not between 48 and 57
|
|
and ascii(substring(email,@num,len(email))) <> 32
|
|
and ascii(substring(email,@num,len(email))) <> 40
|
|
and ascii(substring(email,@num,len(email))) <> 41
|
|
and ascii(substring(email,@num,len(email))) <> 43
|
|
and ascii(substring(email,@num,len(email))) <> 44
|
|
and ascii(substring(email,@num,len(email))) <> 45
|
|
and ascii(substring(email,@num,len(email))) <> 46
|
|
and ascii(substring(email,@num,len(email))) <> 95
|
|
and ascii(substring(email,@num,len(email))) <> 39
|
|
and ascii(substring(email,@num,len(email))) <> 47
|
|
and ascii(substring(email,@num,len(email))) <> 63
|
|
|
|
|
|
set @num = @num + 1
|
|
end
|
|
|
|
|
|
--inizio intervento: 05/02/2015 FCianfa Controllo caratteriAnomali su campi Nome e Cognome della tb c6martperiodico.ANAG_CLIENTI
|
|
|
|
set @num = 1
|
|
while @num < 150
|
|
|
|
begin
|
|
insert into #tab_temp
|
|
SELECT ascii(substring(Nome+Cognome,@num,1)),
|
|
substring(Nome+Cognome,@num,1),
|
|
rete,
|
|
Cod_Fiscale,
|
|
'Nome+Cognome',
|
|
Nome+Cognome
|
|
FROM C6MartPeriodico.ANAG_CLIENTI
|
|
WHERE
|
|
ascii(substring(Nome+Cognome,@num,len(Nome))) not between 64 and 90
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) not between 97 and 122
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) not between 48 and 57
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 32
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 40
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 41
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 43
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 44
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 45
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 46
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 95
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 39
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 38
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 47
|
|
and ascii(substring(Nome+Cognome,@num,len(Nome))) <> 63
|
|
|
|
|
|
set @num = @num + 1
|
|
|
|
end
|
|
|
|
--fine intervento: 05/02/2015 FCianfa Controllo caratteriAnomali su campi Nome e Cognome della tb c6martperiodico.ANAG_CLIENTI
|
|
|
|
set @num = 1
|
|
while @num < 150
|
|
|
|
begin
|
|
insert into #tab_temp
|
|
SELECT ascii(substring(Indirizzo,@num,1)),
|
|
substring(Indirizzo,@num,1),
|
|
rete,
|
|
Cod_Fiscale,
|
|
'INDIRIZZO',
|
|
Indirizzo
|
|
FROM C6MartPeriodico.ContrattoSEI
|
|
WHERE
|
|
ascii(substring(Indirizzo,@num,len(Indirizzo))) not between 64 and 90
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) not between 97 and 122
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) not between 48 and 57
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 32
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 40
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 41
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 43
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 44
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 45
|
|
and ascii(substring(Indirizzo,@num,len(Indirizzo))) <> 46
|
|
and ascii(substring(In
|