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)
 Full Text Default Value

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 CONTAINS

http://doc.ddart.net/mssql/sql70/ca-co_15.htm
Go to Top of Page

batott
Starting Member

7 Posts

Posted - 2008-06-10 : 11:50:55
Can you show me an exmaple.....my code looks like:

SELECT *
FROM EventAttribute
WHERE 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.


Go to Top of Page

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 EventAttribute
WHERE 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 *?
Go to Top of Page

batott
Starting Member

7 Posts

Posted - 2008-06-10 : 12:03:30
Nah Im trying to get that behaviour of "*" against my xml column.


Go to Top of Page

batott
Starting Member

7 Posts

Posted - 2008-06-10 : 12:35:40
Im guessing that this cant be done?
Go to Top of Page

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 use

CONTAINS(*,'"patt1" AND "pattern2"...'
Go to Top of Page

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]")






Go to Top of Page

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 Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

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 =(
Go to Top of Page
   

- Advertisement -