December 8, 2010 at 2:06 am
Hi,
i'm a beginner with t sql and i have a table as this :
tableBuilding
(idBuilding int, nameBuilding, typeBuilding)
I must to create a web service
This web service must be receive one parameter as a string
the method t sql must be ask at the tableBuilding give me all rows correspondiing with this string ..
not complicate but here is it my solution but i wonder if it 's correct
declare @building varchar(max)
set @building = 'batiment 1'
SELECT idBuilding, nameBuilding, typeBuilding where namebuilding = @building
i've think to use like '%' + @building + '%' but if i type the CORRECT nameBuilding as parameter no rows as returned !!!!
do you think my solution is correct ?
i'm a beginner 🙂
thanks for your time
December 8, 2010 at 2:27 am
Hi
Just try '%@building%'
December 8, 2010 at 2:34 am
December 10, 2010 at 6:41 am
hi all,
thanks for your comment, time and sample
i've done this task.
have a nice week end
christophe
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply