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 |
|
hueby
Posting Yak Master
127 Posts |
Posted - 2006-03-21 : 12:01:22
|
Hi all, I'm declaring a variable in my SP and bringin that value through VB.Net and CR. Now, I need to place this @POnumber in a LIKE statement as shown below. It does not seems to work though. Before I start troubleshooting everything else, is this correct/possible in a MS SQL SP?CREATE PROCEDURE [xspInvoiceLookup] (@POnumber VARCHAR(25)) ASSELECT *FROM tablenamewhere blahblah LIKE '%@POnumber%' |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-03-21 : 12:06:37
|
Try this:where blahblah LIKE '%'+@POnumber+'%' CODO ERGO SUM |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-22 : 00:59:22
|
| orWhere charindex(@POnumber,blahblah)>0MadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-03-22 : 01:43:28
|
| Your column names sound like the data our clients store in our databases!Kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-22 : 03:00:18
|
quote: Originally posted by Kristen Your column names sound like the data our clients store in our databases!Kristen
MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|