I'm using a stored procedure to pull records out of a
database and populate an asp page by searching the DB for
key words. It works perfectly unless the title(varchar
255) of one of the records in the database contains the
string "1-" in it. ex: "Management 1-Managing Change" It,
instead of pulling one record out of the database, pulls 2
identical records out (there are NO duplicate records in
the DB) and displays them. This again only happens when a
1- is in the title of the record. This is very pecuiliar
to me. This occurs with SQL Server 7 sp2. If you have
any thoughts or solutions, please respond. Here's the proc
(I altered the code to work in query analyzer to debug):
Select * from vwResources,tProviders, ResourceFormatXref
Where vwResources.iProvider=tProviders.iProviderID
AND
ResourceFormatXref.ResourceID=vwResources.ResourceID
AND Active<>0
AND (vwResources.Title LIKE '%Management 1-
Managing Change%'
OR vwResources.origin
LIKE '%Management 1-Managing Change%'
OR
vwResources.Shortdescription LIKE '%Management 1-Managing
Change%'
OR vwResources.Description
LIKE '%Management 1-Managing Change%'
OR vwResources.Location
LIKE '%Management 1-Managing Change%'
OR vwResources.Components
LIKE '%Management 1-Managing Change%'
OR vwResources.Keywords
LIKE '%Management 1-Managing Change%'
OR vwResources.Audience
LIKE '%Management 1-Managing Change%')
AND vwResources.ResourceID NOT IN
(SELECT ResourceID
FROM ResourcesCompanyXref
WHERE CompanyID = 10)
ORDER BY Title
It also happens with this unaltered stored procedure.
SELECT *
FROM vwResources, tProviders, ResourceFormatXref
WHERE vwResources.iProvider =
tProviders.iProviderID AND
ResourceFormatXref.ResourceID =
vwResources.ResourceID AND
Active = - 1 AND vwResources.ResourceID IN
(SELECT ResourceID
FROM ResourceCategoryXref
WHERE CategoryID =@CategoryID) AND
vwResources.ResourceID NOT IN
(SELECT ResourceID
FROM ResourcesCompanyXref
WHERE CompanyID = @CompanyID)
ORDER BY Title
database and populate an asp page by searching the DB for
key words. It works perfectly unless the title(varchar
255) of one of the records in the database contains the
string "1-" in it. ex: "Management 1-Managing Change" It,
instead of pulling one record out of the database, pulls 2
identical records out (there are NO duplicate records in
the DB) and displays them. This again only happens when a
1- is in the title of the record. This is very pecuiliar
to me. This occurs with SQL Server 7 sp2. If you have
any thoughts or solutions, please respond. Here's the proc
(I altered the code to work in query analyzer to debug):
Select * from vwResources,tProviders, ResourceFormatXref
Where vwResources.iProvider=tProviders.iProviderID
AND
ResourceFormatXref.ResourceID=vwResources.ResourceID
AND Active<>0
AND (vwResources.Title LIKE '%Management 1-
Managing Change%'
OR vwResources.origin
LIKE '%Management 1-Managing Change%'
OR
vwResources.Shortdescription LIKE '%Management 1-Managing
Change%'
OR vwResources.Description
LIKE '%Management 1-Managing Change%'
OR vwResources.Location
LIKE '%Management 1-Managing Change%'
OR vwResources.Components
LIKE '%Management 1-Managing Change%'
OR vwResources.Keywords
LIKE '%Management 1-Managing Change%'
OR vwResources.Audience
LIKE '%Management 1-Managing Change%')
AND vwResources.ResourceID NOT IN
(SELECT ResourceID
FROM ResourcesCompanyXref
WHERE CompanyID = 10)
ORDER BY Title
It also happens with this unaltered stored procedure.
SELECT *
FROM vwResources, tProviders, ResourceFormatXref
WHERE vwResources.iProvider =
tProviders.iProviderID AND
ResourceFormatXref.ResourceID =
vwResources.ResourceID AND
Active = - 1 AND vwResources.ResourceID IN
(SELECT ResourceID
FROM ResourceCategoryXref
WHERE CategoryID =@CategoryID) AND
vwResources.ResourceID NOT IN
(SELECT ResourceID
FROM ResourcesCompanyXref
WHERE CompanyID = @CompanyID)
ORDER BY Title