| Author |
Topic |
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 11:40:37
|
| Im not too sure if this is the category to post this...but what value can I pass in the CONTAINS method that will behave like the "*" character in a SELECT query? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-10 : 11:45:09
|
| you can use * for all columns inside CONTAINShttp://doc.ddart.net/mssql/sql70/ca-co_15.htm |
 |
|
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 11:50:55
|
| Can you show me an exmaple.....my code looks like:SELECT *FROM EventAttributeWHERE CONTAINS(EventAttributes,'"*"')It's returning an empty result set. I forgot to mention that this column is an xml type. Im sorry I forgot to mention that on the initial post. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-10 : 11:54:37
|
quote: Originally posted by batott Can you show me an exmaple.....my code looks like:SELECT *FROM EventAttributeWHERE CONTAINS(EventAttributes,'"*"')It's returning an empty result set. I forgot to mention that this column is an xml type. Im sorry I forgot to mention that on the initial post.
Where you asking to search with *? |
 |
|
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 12:03:30
|
| Nah Im trying to get that behaviour of "*" against my xml column. |
 |
|
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 12:35:40
|
| Im guessing that this cant be done? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-10 : 12:40:00
|
quote: Originally posted by batott Im guessing that this cant be done?
I didnt understand your question itself. * in SELECT means select all columns So if your question was to search on all columns of a table for pattern then you can useCONTAINS(*,'"patt1" AND "pattern2"...' |
 |
|
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 12:47:19
|
| Im sorry im not really explaining it very well....I have a table called EventAttribute_tbl and I created a full-text index against the EventAttributes column which is an XML column. My question is: "Does the CONTAINS method have a special character that acts like the * in a SELECT statement" My query is:SELECT * FROM EventAttribute_tbl WHERE CONTAINS(EventAttributes,"[wild card that selects all]") |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-10 : 12:55:08
|
| * is not the wild card character in T-SQL. It is %. I don't know the answer to your question though, but I suppose you could try %.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
batott
Starting Member
7 Posts |
Posted - 2008-06-10 : 13:00:27
|
| Nah it doesnt work...I guess Im going to have to use Dynamic Query =( |
 |
|
|
|