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
 General SQL Server Forums
 New to SQL Server Programming
 Inserting Double Quotes

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2014-01-24 : 11:54:13
Hi All,

I have to insert "" in data and in column name in the output .csv file.

I tried using Quotename function

for ex : QUOTENAME(policy.policyid, '"')AS PolicyID

Result
Policyid
"12135"
"34334"
"56765"

But i need policyId(i.e columnname) uswell in ""

Result
"PolicyId"
"12135"
"34334"
"56765"

How to amend the query. Any help will be highly appreciated.

Thanks

Regards,
SG

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-01-24 : 11:57:48
Like this:
QUOTENAME(policy.policyid, '"')AS ["PolicyID"]
Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2014-01-24 : 12:27:38
Thanks James. Its working !!
Go to Top of Page
   

- Advertisement -