Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. CREATE FUNCTION [dbo].[SearchContacts]
  2. (
  3. @contactsKeyword nvarchar(4000)
  4. )
  5. RETURNS @returntable TABLE
  6. (
  7. [KEY] int,
  8. [RANK] int
  9. )
  10. AS
  11. BEGIN
  12. INSERT @returntable
  13. SELECT [KEY],[RANK] FROM CONTAINSTABLE(dbo.Contact, ([LastName],[FirstName],[Title]), @contactsKeyword)
  14. RETURN
  15. END
  16.  
  17. SELECT
  18. [KEY] = x.KEY,
  19. [RANK] = ???
  20. FROM [dbo].[SearchContacts](@keyword1) x
  21. JOIN [dbo].[SearchContacts](@keyword2) y on x.KEY = y.KEY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement