Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 select query embed resul with double quotes

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2012-11-06 : 10:09:21
I want to use following query, how to get result within dbl quotes all fields, int fields, date field, text fields etc. if null just want to show "".

select actionID, actiondesc, duedate, asignedTo, comments from Tab_description table


result to appear as follows:

"23","myactiondesc","10/26/2012","Mario",""

thanks a lot for the helpful info.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-11-06 : 10:13:08
select
'"'+convert(varchar(20),actionID)+'"',
'"'+actiondesc+'"',
'"'+convert(varchar(10),duedate,103)+'"',
'"'+asignedTo+'"',
'"'+comments+'"'
from Tab_description table


Too old to Rock'n'Roll too young to die.
Go to Top of Page
   

- Advertisement -