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
 General SQL Server Forums
 New to SQL Server Programming
 stored procedure parameters

Author  Topic 

sparrow37
Posting Yak Master

148 Posts

Posted - 2011-07-01 : 01:15:08
How can I pass these two value combination separated by AND/ as parameter value to stored procedure:

'"8033301552*" OR "08033301552*"'

or

'"Taiwo*" AND "Ayedun*"'

I mean do I need to create a string and pass it as paramter?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-01 : 02:20:21
It would be helpful for us to see the way you want to use the example values in a query.
For example "WHERE Column like 'Taiwo%' AND Column like 'Ayedun%' " would be senseless.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sparrow37
Posting Yak Master

148 Posts

Posted - 2011-07-01 : 03:33:49
it is used like this:

WHERE ( CONTAINS ( [Full Name], '"Taiwo*" AND "Ayedun*"' )
Go to Top of Page

jcelko
Esteemed SQL Purist

547 Posts

Posted - 2011-07-03 : 18:20:50
You need to go back to basics. Read about 1NF again. Values in RDBMS are scalars, not expressions, not functions.

>> I mean do I need to create a string and pass it as parameter? <<

You are getting worse! SQL is compiled and not interpreted. Stop programming and read any basic intro book. To quote Dijkstra, "You are doing it completely wrong"

--CELKO--
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Go to Top of Page

sparrow37
Posting Yak Master

148 Posts

Posted - 2011-07-04 : 00:59:41
Hi jcelko:

No need to be harsh please. I have fuixed the issue. problem was with full text index in view.

Dijkstra: Thanks for suggestion

Regards,
Asif Hameed
Go to Top of Page
   

- Advertisement -