Click here to Skip to main content
16,020,378 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
is possible to use append keyword in stored proceedures?

SQL
IF @CityID <> 0
		SET @SQLQuery = @SQLQuery + ' AND CityID = @CityID '
IF @IndustryID <> 0
		SET @SQLQuery = @SQLQuery + ' AND IndustryID = @IndustryID'


instead of " + " this can I use "APPEND" Keyword?
Posted
Updated 9-Jan-13 18:53pm
v3
Comments
RDBurmon 10-Jan-13 0:35am    
Explain it using some good and clear word and to make it more clear add some live example
RDBurmon 10-Jan-13 0:46am    
Explain in some better words and if possible the insert some live example.
prashant patil 4987 10-Jan-13 0:56am    
why r u use appent instead of +??Be specify you question ..very clear..
FspFriends 10-Jan-13 0:58am    
i want to know one thing only whether i can use APPEND keyword instead of "+"
keyword

 
Share this answer
 
No direct function like c#,vb.net provides using string-builder...

In SQL,
using some string function and concatanation you can append values
depends on requirement

feed new string in left/right hand side or in between

e.g.
SQL
declare @mytext varchar(10)
declare @Feed varchar(10)
set @mytext = 'Apple Cat '
set @Feed = 'Bat '

select @feed + @mytext --LHS
select @myText + @feed --RHS

select substring(@mytext,1,6) + @Feed + right(@mytext,4) --between
--or
select left(@mytext,6) + @Feed + right(@mytext,4) --between

also visit... for more string functions
http://msdn.microsoft.com/en-us/library/ms181984.aspx[^]
Happy Coding!
:)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900