Hi Group:
Hope this is the right forum...
Occasionally, when I write data to a linked Excel file from a varchar(50)
field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
seem to have the tick in SQL when I view in QA. Any ideas why this would be,
or how I can avoid that?
Thanks!
eric db
Eric,
The apostrophe has to do with the leading zeros in you data, in Excel (and I
believe in 2003 version, it's no longer happening), Excel treats the values
in order not to lose them, thus puts the apostrophe in front. You want to
make sure that the Excel column is formatted for the data type you wanted to
be formatted before pouring the data in.
Hopefully, it helped.
"eric db" wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would be,
> or how I can avoid that?
> Thanks!
> eric db
|||Excel does this to indicate the cell value should be treated as text -
but what you've passed in is probably convertible to an int or
something, so Excel explicitly states it's text by adding the (')
Simon Worth
eric db wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would be,
> or how I can avoid that?
> Thanks!
> eric db
Showing posts with label write. Show all posts
Showing posts with label write. Show all posts
Monday, March 26, 2012
Linked to Excel - data changed on export
Hi Group:
Hope this is the right forum...
Occasionally, when I write data to a linked Excel file from a varchar(50)
field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
seem to have the tick in SQL when I view in QA. Any ideas why this would be,
or how I can avoid that?
Thanks!
eric dbEric,
The apostrophe has to do with the leading zeros in you data, in Excel (and I
believe in 2003 version, it's no longer happening), Excel treats the values
in order not to lose them, thus puts the apostrophe in front. You want to
make sure that the Excel column is formatted for the data type you wanted to
be formatted before pouring the data in.
Hopefully, it helped.
"eric db" wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would b
e,
> or how I can avoid that?
> Thanks!
> eric db|||Excel does this to indicate the cell value should be treated as text -
but what you've passed in is probably convertible to an int or
something, so Excel explicitly states it's text by adding the (')
Simon Worth
eric db wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would b
e,
> or how I can avoid that?
> Thanks!
> eric dbsql
Hope this is the right forum...
Occasionally, when I write data to a linked Excel file from a varchar(50)
field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
seem to have the tick in SQL when I view in QA. Any ideas why this would be,
or how I can avoid that?
Thanks!
eric dbEric,
The apostrophe has to do with the leading zeros in you data, in Excel (and I
believe in 2003 version, it's no longer happening), Excel treats the values
in order not to lose them, thus puts the apostrophe in front. You want to
make sure that the Excel column is formatted for the data type you wanted to
be formatted before pouring the data in.
Hopefully, it helped.
"eric db" wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would b
e,
> or how I can avoid that?
> Thanks!
> eric db|||Excel does this to indicate the cell value should be treated as text -
but what you've passed in is probably convertible to an int or
something, so Excel explicitly states it's text by adding the (')
Simon Worth
eric db wrote:
> Hi Group:
> Hope this is the right forum...
> Occasionally, when I write data to a linked Excel file from a varchar(50)
> field, it arrives with a preceding single apostrophe (') in Excel. Doesn't
> seem to have the tick in SQL when I view in QA. Any ideas why this would b
e,
> or how I can avoid that?
> Thanks!
> eric dbsql
Wednesday, March 7, 2012
server to SQL-Server Question
I've been trying to work with Linked Servers for the first time, with
mixed success. My problem right now is in trying to write a View using
a linked server. The linked server is another SQL-Server, and it was
set up using the 'Enterprise Manager' interface. When the server was
created, the name was given as the full server address -
name.pyr.ec.gc.ca.
mixed success. My problem right now is in trying to write a View using
a linked server. The linked server is another SQL-Server, and it was
set up using the 'Enterprise Manager' interface. When the server was
created, the name was given as the full server address -
name.pyr.ec.gc.ca.
When I try and use this name in a new view, I enter the name in the
query as [name.pyr.ec.gc.ca].database.dbo.table. SQL-Server rewrites
this name as name.[pyr.ec.gc.ca.database].dbo.table table_1
I'm sure this is me not understanding something about using linked
servers, but it seems strange to me none the less. Is there a way for
me to create the linked server using sp_addlinkedserver, which would
not require the full server address as the linked server name? Or is my
view syntax not correct? Or can I just not create the query as a view?
I've looked around the new groups, but have no answers yet. Any help
would be much appreciated.
Timnever mind....finally found a single entry in BOL that explained it.
Subscribe to:
Posts (Atom)