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.
| Author |
Topic |
|
njleye
Starting Member
3 Posts |
Posted - 2011-12-21 : 02:57:26
|
| Dear All,I have made a StoreProcedure ( SP may return any text match (with text box whichever data is entered by user) contain in address field of database.) having below select query to get the data using wildcard parameter;SELECT * from ledg where Address = '%@Address%'Now the required data of above query is not being received, as SP created successfully. Kindly help me in this matter if it is possible at your end.Best Regards, |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-12-21 : 03:03:19
|
| You need to execute it to get the resultEXEC procedure_nameMadhivananFailing to plan is Planning to fail |
 |
|
|
sql-programmers
Posting Yak Master
190 Posts |
Posted - 2011-12-21 : 04:01:32
|
| Hi,You SELECT Statement is wrong.Use LIKE Statement instead of '='. same time dont write like bcoz u parameter varible inside the quotes. this query will find '@Address' word in Address column.SELECT * from ledg where Address = '%@Address%'SO Use below SP it may help.alter proc upcGetResult @Address varchar(255)AS SELECT * from ledg where Address like '%'+@Address+'%' GoSQL Server Programmers and Consultantshttp://www.sql-programmers.com/ |
 |
|
|
|
|
|