Compare Strings After Character I need to check email addresses against an internal known bad domain database.  My internal database has domains in the form of myfreepaysite.com just no @ sign.  I have been using this syntax to check, but it locks up my SSMS for roughly 90 seconds then unfreezes.  Is there a better way to do such?

Create Table #Testing
(
  emaildomain varchar(Max)
)
INSERT INTO #Testing VALUES ('myfreepaysite.com')


Create Table #DataToCheck
(
  fullemail varchar(max)
)
Insert Into #DataToCheck VALUES('rr1234@myfreepaysite.com')

Select Top 1 
fullemail
,SUBSTRING(fullemail, CHARINDEX('@', fullemail) + 1, LEN(fullemail))
FROM #DataToCheck
WHERE SUBSTRING(fullemail, CHARINDEX('@', fullemail) + 1, LEN(fullemail)) IN (Select emaildomain FROM #Testing)
Something that I've done in the past for searching emails by domain name is to reverse the email address and the domain. Then I can use the LIKE operator with a wildcard and the resulting query should be sargable. You can read this Brent Ozar post about why this is helpful. The short version is reversing our email address and search term will allow us to use indexes. I don't think you'll need to do this based on the table sizes you mentioned in the comments but just in case you're curious you can create indexes on temp tables.

Disregarding indexes on the temp tables reversing things would make your original query look like this:

Create Table #Testing
(
  emaildomain varchar(100) -- You can't index max and it isn't needed
);
INSERT INTO #Testing
VALUES (REVERSE('@myfreepaysite.com')); -- Reversed &amp; prepended the @ sign
                                        -- to ensure full domain matching

Create Table #DataToCheck
(
  fullemail varchar(200) -- You can't index max and it isn't needed
);
Insert Into #DataToCheck
VALUES(REVERSE('rr1234@myfreepaysite.com')); -- reversed

Select Top 1 
  REVERSE(d.fullemail) -- Changed
  ,REVERSE(t.emaildomain) --Changed
FROM #DataToCheck AS d
  INNER JOIN #Testing AS t ON d.fullemail LIKE t.emaildomain + '%'; -- Changed


That should be easier to read and perform better as well. Also note that I reduced the size of your EmailDomain and FullEmail columns. I did this because you can't index a VARCHAR(MAX) but more importantly you should scope your columns to the data sizes and types they'll actually contain.