为什么Excel有时会在工作表名称上加一个$? [英] Why does Excel sometimes put a $ on sheet name?

查看:311
本文介绍了为什么Excel有时会在工作表名称上加一个$?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现有时但并非总是如此,Excel仅在尝试使用C#将其导入到SQL Server时,在工作表名称的末尾放置一个 $ ,但这在Excel中是看不到的.我遇到了许多不同的情况.

I have found sometimes but not always, Excel puts a $ at the end of a worksheet name but that is not seen in Excel, only when trying to import it into SQL Server using C#. I've run into a number of different scenarios with this.

  1. 它会离开原始工作表,但还会创建第二个空的隐藏"工作表,并在末尾带有 $ .
  2. 只有1个工作表,并且具有数据,但名称后附加了" $ ".
  3. 原始工作表在那里带有 $ ,并且还有另一个副本附加了 $ _ filteredDatabase .(我发现 _filteredDatabase 是Excel存储已过滤"数据的位置.)
  1. It leaves the original worksheet but also creates a second empty 'hidden' worksheet with the $ at the end.
  2. There is only 1 worksheet and it has the data but the '$' is appended to the name.
  3. The original worksheet is there with the $ and there is another copy with $_filteredDatabase appended. (I was able to find that _filteredDatabase is where Excel stores the 'filtered' data.)

我问的原因是过去,我已经能够告诉我的应用程序导入,如果只有1个工作表,或者它不以 $ 结尾.但是,有几次我最终得到一个" worksheet $ "和一个" worksheet $ _ ".

The reason I ask is in the past I've been able to tell my application to import if there is only 1 worksheet or if it does not end in $. However there have been a few times that I've ended up with a "worksheet$" and a "worksheet$_".

所以我只是想知道是否有人知道 $ 是什么,或者为什么/何时添加它?

So I'm just wondering if anyone knows what the $ is or why/when it gets added?

推荐答案

使用 Excel Source 时-Excel source从Microsoft Excel工作簿中的工作表或范围中提取数据-SQL Server联机丛书说:

When you use Excel Source -Excel source extracts data from worksheets or ranges in Microsoft Excel workbooks- SQL Server Books-Online says:

重要提示:
在Excel中,工作表或范围等同于表或视图.Excel Source和Destination编辑器中的可用表列表显示现有工作表(由附加在工作表名称上的 $ 符号标识,例如 Sheet1 $ )和命名范围(通过缺少 $ 符号(例如 MyRange )来标识.

Important:
In Excel, a worksheet or range is the equivalent of a table or view. The list of available tables in the Excel Source and Destination editors displays existing worksheets (identified by the $ sign appended to the worksheet name, such as Sheet1$) and named ranges (identified by the absence of the $ sign, such as MyRange).

数据源
Excel工作簿中的数据源可以是工作表,必须在其上附加 $ 符号(例如 Sheet1 $ )或命名范围(例如, MyRange ).在SQL语句中,必须分隔工作表的名称(例如, [Sheet1 $] ),以避免由 $ 符号引起的语法错误.查询生成器会自动添加这些定界符.当您指定工作表或范围时,驱动程序将从工作表或范围的左上角的第一个非空单元格开始读取连续的单元格块.因此,源数据中不能有空行,标题或标题行与数据行之间不能有空行.

Data sources
The source of data in an Excel workbook can be a worksheet, to which the $ sign must be appended (for example, Sheet1$), or a named range (for example, MyRange). In a SQL statement, the name of a worksheet must be delimited (for example, [Sheet1$]) to avoid a syntax error caused by the $ sign. The Query Builder automatically adds these delimiters. When you specify a worksheet or range, the driver reads the contiguous block of cells starting with the first non-empty cell in the upper-left corner of the worksheet or range. Therefore you cannot have empty rows in the source data, or an empty row between title or header rows and the data rows.

这篇关于为什么Excel有时会在工作表名称上加一个$?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆