Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Using Like in If condition

$
0
0
Hi..

A value is being passed to the procedure as a parameter. Within this procedure, can another variable be declared to hold this value and apply some conditions like:

if @sample is the parameter being passed to the proc externally,
will the below be possible inside the procedure:

Code:

declare @sam char(9)
select sam=@sample

if ( @sam like 'A%')
begin
---
---
else
---
---
end

Any help would be greatly appreciated.

Many thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles