Well Executing the statement:
SELECT * FROM employee
WHERE fname like '%' + @fname + '%'
is increasingly different then executing
SELECT * FROM employee
WHERE fname like @fname + '%'
In the first example, SQL Searches the fname field for ANY instance of, in your case, pa. So, if there was a name in the database of SPADE that would be returned by this query because the string SPADE does, in fact, contain the string 'PA'.
If you are looking for ONLY strings that begin with a letter and not necessarily contained anywhere in the string, you would use the second example above and it will only return names that begin with PA.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========