Matching a smaller piece of text in a local variable to a larger piece of text that I have pulled in a query

Posted by Hoser on Server Fault See other posts from Server Fault or by Hoser
Published on 2012-06-08T16:04:52Z Indexed on 2012/06/08 16:42 UTC
Read the original article Hit count: 173

Filed under:

I think this is a simple question, but google searching for 30 minutes was mostly wasted time as all I can find is matching a variable to a 'randompieceoftext'.

Anyways, suppose I have a local variable called @ServerName. This server name will be something like CCPWIQAUL. I need to match this server name to various path names, which is of the form:

serverName.something.somethingelse.com

These path names are pulled from a database, and will be in the column vManagedEntity.Path

How do I do something like this?

Is @ServerName is IN vManagedEntity.Path?

© Server Fault or respective owner

Related posts about sql-server-2005