Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hi,I have following tables:Customers-------------CustomerID intCustomerName varchar(50)...Orders-------------OrderID intDescription varchar(50)...How can I perform a full-text query against both CustomerName and Description columns as same time? so I can retrieve search result like: CustomerID, CustomerName, OrderID, Description...Thanks,Tien,
Kristen
Test
22859 Posts
Posted - 2005-09-01 : 00:52:06
Would this do?
SELECT 'Customer' AS [Source], CustomerID AS [ID], CustomerName AS [Description]FROM CustomersWHERE CustomerName LIKE '%FRED%'UNION ALLSELECT 'Orders' AS [Source], OrderID, DescriptionFROM OrdersWHERE Description LIKE '%FRED%'ORDER BY [Source], [ID]
Kristen
Tien
Starting Member
12 Posts
Posted - 2005-09-02 : 22:12:00
Thanks but I want to search with full-text query, not with LIKE keyword :)
Kristen
Test
22859 Posts
Posted - 2005-09-03 : 01:47:07
Could you use the same idea with a Union, and the CONTAINS syntax for a Full Text query?Kristen