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.
| Author |
Topic |
|
saini_balvinder
Starting Member
22 Posts |
Posted - 2008-01-22 : 22:59:36
|
| Hello,is there some way to avoid single quote for all fields (including text) in excel when we export data from sql server? i dont want to have any single quote in excel when i export data. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2008-01-23 : 00:14:19
|
| Replace(fieldName, Char(39), '') |
 |
|
|
saini_balvinder
Starting Member
22 Posts |
Posted - 2008-01-23 : 00:50:35
|
| where to use this function? in select clause before data generation or after that? |
 |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-01-23 : 00:55:52
|
| In select clause where you are getting result like Select Replace(QuoteFiels, Char(39), '') as [WithoutQuote] from yourtableexample: declare @Table4 table( nam varchar(30))Insert into @Table4 values('sunil''s')Select Replace(nam, Char(39), '') as [WithoutQuote] from @Table4 |
 |
|
|
saini_balvinder
Starting Member
22 Posts |
Posted - 2008-01-23 : 01:09:07
|
| thanks for the information. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-23 : 03:48:42
|
| Run this to know how single quotes workselect '','''','''''','''''''',''''''''''MadhivananFailing to plan is Planning to fail |
 |
|
|
saini_balvinder
Starting Member
22 Posts |
Posted - 2008-01-23 : 04:12:18
|
| the db table does not have any single quote. it is plain text or number. but when exporting to excel single quote comes for each cell. how to make sure that in excel the same data is displayed which is there in table?do i still have to use replace function in select statement?but table does not have any single quote. |
 |
|
|
saini_balvinder
Starting Member
22 Posts |
Posted - 2008-01-23 : 23:42:12
|
| one more thing guys... if i export data directly from table (right click on table name --> All Tasks --> Export data) and export it to excel i get single quotes in front of all cells. However the data in db table does not have single quotes. how to avoid this? |
 |
|
|
|
|
|