Groups | Blog | Home
all groups > sql server full text search > february 2004 >

sql server full text search : Return Column Name


ChuckCraig
2/5/2004 8:16:06 AM
I have to FTS 50+columns across 3 joined tables. The search returns the appropriate result-set, however I need to know which columns contained the search criteria. So while my Select will have 50+ columns I need to idntify which casused them to be returns.

We're using

Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows NT 5.0 (Build 2195: Service Pack 3)

Here is the (large) T-SQL statement

Thanks inadvance
Chuck

SELECT AssetID,
AssignedRC,
LocBldg,
LocFloor,
LocOther,
TrackingNum,
CityAssetTagNum,
MassPlantIDNum,
SerialNum,
VendorPartNum,
Comments,
RMANum,
RMAReason,
RetireReason,
PreviousAssetID,
MaintVendor,
ServAgreeNum,
NetName,
PrintServer,
ORI,
VTAM1,
VTAM2,
SMART_Asset.Memory,
SMART_Asset.MemoryUnits,
SMART_Asset.Storage,
SMART_Asset.StorageUnits,
SMART_Asset.OS,
DomainName,
AKA,
BusinessImpact,
NonCatItemDesc,
SMART_Asset.EnterBy,
SMART_Asset.UpdateBy,
SMART_OrderCatalog.CatalogID,
AssetType,
AssetSubType,
Owner,
Description,
ExtendDesc,
Model,
Version,
ManPartNum,
SMART_OrderCatalog.Memory as OrderCatalog_Memory,
SMART_OrderCatalog.MemoryUnits as OrderCatalog_MemoryUnits,
SMART_OrderCatalog.Storage as OrderCatalog_Storage,
SMART_OrderCatalog.StorageUnits as OrderCatalog_StorageUnits,
SMART_OrderCatalog.OS as OrderCatalog_OS,
WarrantyDuration,
User_ID,
Legal_Name,
Employee_ID,
Preferred_Name,
Department_Name,
Division_Name,
Location_Name,
Bus_Address,
Bus_Phone,
SMART_Asset.ReceivedDate,
SMART_Asset.GrantExpDate,
SMART_Asset.RetireDate,
SMART_Asset.WarrExpDate,
SMART_Asset.EnterDate,
SMART_Asset.UpdateDate,
SMART_Asset.LastAuditDate
FROM dbo.SMART_Asset
LEFT JOIN dbo.SMART_OrderCatalog
ON dbo.SMART_Asset.CatalogID = dbo.SMART_OrderCatalog.CatalogID
LEFT JOIN dbo.City_Workers
ON dbo.SMART_Asset.AssignedEmplID = COALESCE (dbo.City_Workers.Employee_ID ,
dbo.City_Workers.Employee_ID)
WHERE CONTAINS (dbo.SMART_Asset.*, @Var1)
OR CONTAINS (dbo.SMART_OrderCatalog.*, @Var1)
OR CONTAINS (dbo.City_Workers.*, @Var1)
OR CAST(AssetID AS VARCHAR(50)) = @Var1

ChuckCraig
2/5/2004 10:36:05 AM
Thanks for your promt reply

Not the answer I wanted thought, I suppose I could always fill a cursor with the results and then evaluate each row in the cursor column by column

Regards

Hilary Cotter
2/5/2004 11:46:46 AM
this function is not exposed in SQL FTS.
[quoted text, click to view]
appropriate result-set, however I need to know which columns contained the
search criteria. So while my Select will have 50+ columns I need to idntify
which casused them to be returns.
[quoted text, click to view]
Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows
NT 5.0 (Build 2195: Service Pack 3)
[quoted text, click to view]

AddThis Social Bookmark Button