Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 1 decade ago

how to write a LIKE statement in sql server 2000 using variable instead some string?

SQL also does the heavy lifting for you if you're doing any sort of pattern searches too. For example, given a column with VARCHAR contents, you could do these sorts of things:

WHERE someColumn LIKE "Green%" (finds all that start with "Green")

WHERE someColumn LIKE "%Green" (finds all that end with "Green")

WHERE someColumn LIKE "%Green%" (finds all with "Green" anywhere within it)

WHERE someColumn LIKE "_Green%" (finds all with "Green" in positions 2-6)

etc. , in the above instead green, i want to use variable, how to write that using sql server 2000 as back end, asp.net with c# as front end

1 Answer

Relevance
Still have questions? Get your answers by asking now.