Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Problem after installing SQL Server SP3

Author  Topic 

vishal.gadhia@gmail.com
Starting Member

4 Posts

Posted - 2009-01-05 : 17:20:57
Hi:
I have a query in which I am using the PATINDEX function in the WHERE clause.
This was working fine until, i installed the SQL SERVER 2005 Service Pack 3.
Please let me know, if some one knows about this issue or is facing the same.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-05 : 17:31:27
Could you post the code and show us a data example of why it is wrong?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

vishal.gadhia@gmail.com
Starting Member

4 Posts

Posted - 2009-01-05 : 19:00:35
SELECT card_guid,
IsNull(first_name, ''),
IsNull(last_name, ''),
IsNull(company, ''),
data
FROM card
WHERE file_id = @file_id
AND PATINDEX(@search_pattern, data) > 0
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-05 : 19:33:05
So where is the sample data? We need to know what you are passing into the variables and what output you are getting.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

vishal.gadhia@gmail.com
Starting Member

4 Posts

Posted - 2009-01-06 : 10:36:50
ALTEr PROCEDURE [dbo].[usp_list_cards_by_search_string]
@user_guid uniqueidentifier,
@file_guid uniqueidentifier,
@sort_tag1 nvarchar(255),
@sort_tag2 nvarchar(255),
@sort_tag3 nvarchar(255),
@srch_str nvarchar(255)

DECLARE @search_pattern nvarchar(255)
SELECT @search_pattern = '%' + @srch_str + '%'

SELECT card_guid,
IsNull(first_name, ''),
IsNull(last_name, ''),
IsNull(company, ''),
data
FROM card
WHERE file_id = @file_id
AND PATINDEX(@search_pattern, data) > 0

OUTPUT-: ALL THE ROWS THAT WHOSE PATINDEX() > 0
Go to Top of Page
   

- Advertisement -