Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE FUNCTION [dbo].[SearchContacts]
- (
- @contactsKeyword nvarchar(4000)
- )
- RETURNS @returntable TABLE
- (
- [KEY] int,
- [RANK] int
- )
- AS
- BEGIN
- INSERT @returntable
- SELECT [KEY],[RANK] FROM CONTAINSTABLE(dbo.Contact, ([LastName],[FirstName],[Title]), @contactsKeyword)
- RETURN
- END
- SELECT
- [KEY] = x.KEY,
- [RANK] = ???
- FROM [dbo].[SearchContacts](@keyword1) x
- JOIN [dbo].[SearchContacts](@keyword2) y on x.KEY = y.KEY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement