Return the all column values of table in comma separated in SQLServer

Declare @Var Varchar(8000)
  Select  @Var = COALESCE(@Var+',' , ' ') + qty FROM mytab
  SELECT  @Var


result is:- a,b,c,d,e,f

Comments

Popular posts from this blog

GROUP BY, CUBE, ROLLUP and SQL SERVER 2005

How to get content of Ckeditor & Fckeditor using Javascript

How to Fix Error- Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out