Matching a smaller piece of text in a local variable to a larger piece of text that I have pulled in a query
You can use the CHARINDEX() function to do this:

SELECT vManagedEntity.Path
FROM vManagedEntity.Path
WHERE CHARINDEX(@ServerName,Path) &gt; 0


Or, you can craft a LIKE query:

Assuming you want to do a Starts With match on the Path field:

SELECT vManagedEntity.Path
FROM vManagedEntity.Path
WHERE Path LIKE @ServerName + '%'


If you want to do an Ends With, change to:

SELECT vManagedEntity.Path
FROM vManagedEntity.Path
WHERE Path LIKE '%' + @ServerName


Or, a Contains:

SELECT vManagedEntity.Path
FROM vManagedEntity.Path
WHERE Path LIKE '%' + @ServerName + '%'