Skip to main content
deleted 2 characters in body
Source Link
paparazzo
  • 5.1k
  • 1
  • 19
  • 32

A reach

I think you mean LEN([dmn].[DOMAIN])

It should not matter but maybe use

[DOMAIN] [nvarchar](75) NOT NULL

and make it a clustered index

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO''Yes'
                     ELSE 'Yes''NO'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
      on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1+1, LEN([dmn].[DOMAIN]))
WHERE dt.[accept] is null

A reach

I think you mean LEN([dmn].[DOMAIN])

It should not matter but maybe use

[DOMAIN] [nvarchar](75) NOT NULL

and make it a clustered index

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO'
                     ELSE 'Yes'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
      on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1, LEN([dmn].[DOMAIN]))
WHERE dt.[accept] is null

A reach

I think you mean LEN([dmn].[DOMAIN])

It should not matter but maybe use

[DOMAIN] [nvarchar](75) NOT NULL

and make it a clustered index

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is null
                     THEN 'Yes'
                     ELSE 'NO'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
      on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email])+1, LEN([dmn].[DOMAIN]))
WHERE dt.[accept] is null
added 45 characters in body
Source Link
paparazzo
  • 5.1k
  • 1
  • 19
  • 32

aA reach

I think you mean LEN([dmn].[DOMAIN])

It should not matter but maybe use

[DOMAIN] [nvarchar](75) NOT NULL

and make it a clustered index

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO'
                     ELSE 'Yes'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
      on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1, LEN([dt][dmn].[email])[DOMAIN]))
WHERE dt.[accept] is null

a reach

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO'
                     ELSE 'Yes'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
  on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1, LEN([dt].[email])))
WHERE dt.[accept] is null

A reach

I think you mean LEN([dmn].[DOMAIN])

It should not matter but maybe use

[DOMAIN] [nvarchar](75) NOT NULL

and make it a clustered index

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO'
                     ELSE 'Yes'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
      on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1, LEN([dmn].[DOMAIN]))
WHERE dt.[accept] is null
Source Link
paparazzo
  • 5.1k
  • 1
  • 19
  • 32

a reach

UPDATE dt
SET dt.[accept] = case    
                     when [dmn].[DOMAIN] is not null
                     THEN 'NO'
                     ELSE 'Yes'
                  END
FROM [dbo].[Data] dt 
LEFT JOIN dbo].[Domains] dmn
  on [dmn].[DOMAIN] = SUBSTRING([dt].[email], CHARINDEX('@', [dt].[email]) + 1, LEN([dt].[email])))
WHERE dt.[accept] is null