|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: |
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[JobSearch]
(
@startRowIndex int,
@maximumRows int,
@firstString varchar(50)='',
@secondString varchar(50)='',
@thirdString varchar(50)='',
@CountryRequest int = 0
)
AS
DECLARE @TempItems TABLE
(
ID int IDENTITY,
jobs_id uniqueidentifier,
jobs_title varchar(255),
jobs_refid bigint,
jobs_date smalldatetime,
jobs_preview varchar(500),
companys_name varchar(200),
companys_id bigint,
citys_text varchar(50),
countrys_short varchar(50),
jobs_citys_id int,
jobs_countrys_id int,
citys_id numeric(18, 0),
countrys_id numeric(18, 0),
jobs_description text,
jobs_keywords text
)
DECLARE @SearchTerms nvarchar(500);
IF NOT @firstString = ''
BEGIN
SET @SearchTerms = '(' + @firstString + ')'
END
IF NOT @secondString = '' AND NOT @SearchTerms = ''
BEGIN
SET @SearchTerms = @SearchTerms + ' OR (' + @secondString + ')'
END
IF NOT @thirdString = '' AND NOT @SearchTerms = ''
BEGIN
SET @SearchTerms = @SearchTerms + ' OR (' + @thirdString + ')'
END
IF NOT @SearchTerms = ''
BEGIN
SET @SearchTerms = ' AND (CONTAINS (job.jobs_title,' + @SearchTerms + ') OR CONTAINS (job.jobs_description,' + @SearchTerms + ') OR CONTAINS (job.jobs_keywords,' + @SearchTerms + '))'
END
DECLARE @CountryString varchar(20);
IF NOT @CountryRequest = 0
BEGIN
SET @CountryString = ' AND jobs_citys_id = ' + @CountryRequest
END
DECLARE @maxRow int
SET @maxRow = (@startRowIndex + @maximumRows) - 1
SET ROWCOUNT @maxRow
INSERT INTO @TempItems (jobs_id,jobs_title,jobs_refid,jobs_date,jobs_preview,companys_name,companys_id,citys_text,countrys_short,jobs_citys_id,jobs_countrys_id,citys_id,countrys_id,jobs_description,jobs_keywords)
SELECT jobs_id,jobs_title,jobs_refid,jobs_date,jobs_preview,companys_name,companys_id,citys_text,countrys_short,jobs_citys_id,jobs_countrys_id,citys_id,countrys_id,jobs_description,jobs_keywords
FROM jobs
LEFT JOIN companys ON companys_id = jobs_companys_id
LEFT JOIN citys ON citys_id = jobs_citys_id
LEFT JOIN countrys ON countrys_id = jobs_countrys_id
ORDER BY jobs_date DESC
SET ROWCOUNT @maximumRows
EXEC('SELECT job.jobs_id,job.jobs_title,job.jobs_refid,job.jobs_date,job.jobs_preview,company.companys_name,company.companys_id,city.citys_text,country.countrys_short
FROM @TempItems tmp
LEFT JOIN jobs job ON job.jobs_id = tmp.jobs_id
LEFT JOIN companys company ON company.companys_id = tmp.companys_id
LEFT JOIN citys city ON city.citys_id = tmp.citys_id
LEFT JOIN countrys country ON country.countrys_id = tmp.countrys_id
WHERE ID >= @startRowIndex'+ @SearchTerms + @CountryString)
SET ROWCOUNT 0
|
Advertisement
| Hall of Fame |