Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2006, 01:40 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Find String in query

I have one input parameter in stored procedure.i want to find out that wether that string parameter contains the "Special" word or not.how will i seach this word in stored procedure?

 
Old September 5th, 2006, 07:30 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I don't understand what you mean. On the most basic level you would do:

SELECT [something] from [table] where [field] like @param + '%'

"The one language all programmers understand is profanity."
 
Old September 5th, 2006, 11:34 PM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

actuallly i have one string parameter in my stored procedure.i want to find some specific words in that string in my stored procedure.like
create procedure test
as
str varchar(100)
begin
//i want to search wether str string contains 'abc' word or not
end

how will i do that

 
Old September 6th, 2006, 03:16 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by vishwadh
 actuallly i have one string parameter in my stored procedure.i want to find some specific words in that string in my stored procedure.like
create procedure test
as
str varchar(100)
begin
//i want to search wether str string contains 'abc' word or not
end

how will i do that

You could do it like...

If (Charindex('abc',@str)>0)
  -- do something

or better yet

if (@str like '%abc%')
  -- do something


Harsh Athalye
India
"Nothing is impossible"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Matching pattern in Given String sanjivbshinde ASP.NET 2.0 Professional 3 October 10th, 2008 06:32 PM
how to find a string in another string in vb6 satish_k VB How-To 3 March 30th, 2007 12:17 PM
syntax to find a string in a string cole SQL Server 2000 2 October 10th, 2005 06:06 PM
JSP string find characters ndanger J2EE 2 November 24th, 2004 09:52 AM
Find the frequency of a char(s) in a string jdang67 SQL Language 8 October 14th, 2004 02:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.