---每个表都要设有主键。。。。
/*--创建视图 SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL,ARITHABORT,QUOTED_IDENTIFIER,ANSI_NULLS ON GO Create view view_ProductList WITH SCHEMABINDING as SELECT ba_ItemNumber.InnerID, dbo.ba_ItemNumber.STInnerID, dbo.ba_ItemNumber.Material, dbo.ba_ShellTrumpet.Code, dbo.ba_ShellTrumpet.Name, dbo.ba_ShellTrumpet.CDescription, dbo.ba_ShellTrumpet.Vulgo, dbo.ba_ShellTrumpet.EDescription, dbo.ba_ShellTrumpet.Specification, dbo.ba_ShellTrumpet.Od, dbo.ba_ShellTrumpet.StandardClass, dbo.ba_ShellTrumpet.Diameter, dbo.ba_ShellTrumpet.PremiumOld, dbo.ba_ShellTrumpet.PremiumNew, dbo.ba_ItemNumber.InvoiceName, dbo.ba_ItemNumber.OutsidePriceOld, dbo.ba_ItemNumber.OutsidePriceNew, dbo.ba_ItemNumber.MainUnit, dbo.ba_ItemNumber.ViceUnit, dbo.ba_ItemNumber.Singlet, dbo.ba_ItemNumber.Bag, dbo.ba_ItemNumber.Box, dbo.ba_ItemNumber.Cartons, dbo.ba_ItemNumber.BoxSize, dbo.ba_ItemNumber.BoxGW, dbo.ba_ItemNumber.CartonsSize, dbo.ba_ItemNumber.CartonsGW, dbo.ba_ItemNumber.DrawingsUrl, dbo.ba_ItemNumber.WhetherStanding, dbo.ba_ItemNumber.MinimumOrderQuantity, dbo.ba_ItemNumber.CountLimit, dbo.ba_ItemNumber.CountLower, dbo.ba_ItemNumber.MallDisplayNumber, dbo.ba_ItemNumber.StoreMaxNumber, dbo.ba_ItemNumber.GeneralDelivery, dbo.ba_ItemNumber.ExceedDelivery, dbo.ba_ItemNumber.SurfaceTreatment, dbo.ba_ItemNumber.Tage, dbo.ba_ItemNumber.HeatTreatment, dbo.ba_ItemNumber.StrengthGrade, dbo.ba_ItemNumber.TheCorrespondingMold, dbo.ba_ItemNumber.Remark, dbo.ba_ItemNumber.RemarkSpecial, dbo.ba_ItemNumber.RemarkSpecialInside, dbo.ba_ItemNumber.MiniPackageUnit, dbo.ba_ItemNumber.MiniPackageQuantity, dbo.ba_ItemNumber.Inventory, dbo.ba_ItemNumber.BulkInventory, dbo.ba_ItemNumber.DefectiveInventory, dbo.ba_ItemNumber.BarCode, dbo.ba_ShellTrumpet.ToothTypeBig, dbo.ba_ShellTrumpet.HeadType, dbo.ba_ShellTrumpet.Groove, dbo.ba_ShellTrumpet.SimilarStandard, dbo.ba_ShellTrumpet.IsDZP, dbo.ba_ItemNumber.StorageLocationFinished, dbo.ba_ItemNumber.StorageLocationBulk, dbo.ba_ItemNumber.pCXM, dbo.ba_ShellTrumpet.Remark AS ShellTrumpetRemark, dbo.ba_ShellTrumpet.RemarkSpecial AS ShellTrumpetRemarkSpecial FROM dbo.ba_ShellTrumpet INNER JOIN dbo.ba_ItemNumber ON dbo.ba_ShellTrumpet.InnerID = dbo.ba_ItemNumber.STInnerID Set ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON SET ARITHABORT ON SET CONCAT_NULL_YIELDS_NULL ON SET QUOTED_IDENTIFIER ON SET NUMERIC_ROUNDABORT OFF */ /*没有为当前数据库启用全文搜索。请使用 sp_fulltext_database 来启用数据库的全文搜索。*/ --EXEC sp_fulltext_database 'enable'; /*创建全文目录*/ --create FULLTEXT CATALOG FTProductList AS DEFAULT /* 首先创建一个唯一索引,以便全文索引利用*/ --create unique clustered index index_view_ProductList on view_ProductList(InnerID) /*index_view_ProductList' 不是可强制使用全文搜索键的有效索引
---查看每个表都要设有主键
create FULLTEXT INDEX ON view_ProductList(InnerID,[Name],STInnerID,Material,Specification,CDescription,BarCode) key index index_view_ProductList ON FTProductList*/select * from view_ProductList where contains(*,'"内六角" or "内六角沉头机螺钉" or "M5*28" or "GB818"')