开发者

Need a Full Text Search sample

Can anyone please provide me a working sproc which contains something like this :

WHERE CONTAINS(cars.brand , COALESCE开发者_JS百科(@brand,cars.brand)) AND


This should get you started, but your WHERE clause needs work.

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
SET ANSI_PADDING ON
GO
SET NOCOUNT ON
GO


IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[theSprocName]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[theSprocName]
GO

CREATE PROCEDURE dbo.theSprocName

    @brand varchar(250)      -- change to suit the anticipated width.

AS

BEGIN

    SELECT SomeField1, SomeField2
    FROM cars
    -- specify what criteria to filter by.
    -- WHERE cars.brand 

END
GO
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜