Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Contains and upper questions

Status
Not open for further replies.

fredodman

Programmer
Jun 7, 2008
15
0
0
US
Hi everyone!

This time I'm trying to fill a C# tree view from a sql query. I have two functions to extract the nodes and in the first one I will have a simple select statement to capture the categories which, in my database are in upper case. I would like to use some statement that will only return the fields in the DB which are completely in upper case.

The second problem is to get to the nodes under the category ones. These all look similar to this Print-Editor so I thought I could use CONTAINS(Description, '-') but the error message tells me the table is not full-text indexed.
Apart from creating the full-texted table, is there any simple solution to this or does anyone have any good ideea how to go about this problem.

As always, any help is greatly appreciated.

Fred
 
Hi,

With the upper case search, you can use binary_checksum

Code:
select * 
from [TABLE]
where binary_checksum([Field]) = binary_checksum(upper([Field]))

I'm not too sure about your second problem. Did you just want to return records that contain '-' ? Why not use "[Field] like '%-%'" ?

Ryan
 
Is your field Description a text field? If so you will not be able to use some functions on the field.

For the upper you could also try COLLATE, but the binary_checksum would be less typing.

Good luck,
djj
 
Hi both of you and thanks fro your help. I actually solved both of my problems with the like statement as you suggested Ryan. Thanks again for the help.

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top