Append text. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Append text.

I want to add some text in a varchar variable, How will it possible. for example. string strVar
for(int i=0;i<5;i++)
{
strVar+=i;
} I want to perform the above functionality in sql server.
declare @strvar varchar(100), @i int
select @strvar=”,@i=0 while @i<5
begin
SET @[email protected]+convert(varchar(10),@i)
set @[email protected]+1
end
select @strvar,@i
]]>

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |