Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 freetext wildcard?

Author  Topic 

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2007-03-14 : 08:52:33
Am I putting the wildcard in the right spot? Does not seem to work when I put it in

SELECT registeredUsers.UserFirstName, registeredUsers.UserLastName, registeredUsers.UserName, registeredUsers.userCreatedDate,
registeredUsers.lastModified, registeredUsers_1.UserFirstName + ' ' + registeredUsers_1.UserLastName AS fullName, registeredUsers.UserID
FROM registeredUsers INNER JOIN
registeredUsers AS registeredUsers_1 ON registeredUsers.useridCreated = registeredUsers_1.UserID
WHERE FREETEXT(registeredUsers.UserLastName, 'smit*')

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 09:20:53
Found this in BOL:

quote:
Remarks
Full-text queries using FREETEXT are less precise than those full-text queries using CONTAINS. The Microsoft® SQL Server™ full-text search engine identifies important words and phrases. No special meaning is given to any of the reserved keywords or wildcard characters that typically have meaning when specified in the <contains_search_condition> parameter of the CONTAINS predicate.


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2007-03-14 : 09:24:52
Not sure what that means?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 09:29:10
That means wildcard characters like '*' has no meaning in FREETEXT(). So if you want it to search for all combinations starting with 'smit', use CONTAINS().

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2007-03-14 : 10:23:36
CONTAINS does not seem to work either??


SELECT registeredUsers.UserFirstName, registeredUsers.UserLastName, registeredUsers.UserName, registeredUsers.userCreatedDate,
registeredUsers.lastModified, registeredUsers_1.UserFirstName + ' ' + registeredUsers_1.UserLastName AS fullName, registeredUsers.UserID
FROM registeredUsers INNER JOIN
registeredUsers AS registeredUsers_1 ON registeredUsers.useridCreated = registeredUsers_1.UserID
WHERE CONTAINS(registeredUsers.UserLastName, 'smith*')
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 10:34:27
Why don't you see the SQL Server help.

Found this:

quote:
Specifies a match of words or phrases beginning with the specified text. Enclose a prefix term in double quotation marks ("") and add an asterisk (*) before the ending quotation mark, so that all text starting with the simple term specified before the asterisk is matched. The clause should be specified this way: CONTAINS (column, '"text*"') The asterisk matches zero, one, or more characters (of the root word or words in the word or phrase). If the text and asterisk are not delimited by double quotation marks, as in CONTAINS (column, 'text*'), full-text search considers the asterisk as a character and will search for exact matches to text*.




Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2007-03-14 : 11:17:20
Thought newsgroups gave help? Notice sarcasm. If you can't help, please do not add useless comments
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 11:25:02
What do you expect from us? a ready-made recipe?

Take some efforts to go through SQL Server books online to see what you can do and how you can do it. Books online has lot of useful examples for each statement. Try to come up with different combinations. When you run out of all the options, then you can ask for help.

Mind it, you are the only one who is going to benefit if you try to think about the possible ways to solve the problem.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -