在将数据附加到 SQL-Server 2005 DTS 中的表之前从文本文件中提取数据
我必须在 2005 年在 DTS 环境中工作(解释起来太复杂),并且我有一个逗号分隔的文本文件要附加到主表中。 我想将文本文件中的最后一列拉出作为第一条记录,并将其用作删除命令的选择条件。 但如何在较旧的 DTS 环境中执行此操作?
这是 foobar 数据行,
9,36,7890432174,2007-12-17 00:00:00.000,21,15.22,99,11,49,28,2009-07-12 00:00:00
我想要做的是创建一个 sql 语句,该语句将删除某个列等于“2009-07-12 00:00:00”的所有记录,
谢谢。
I have to work in a DTS environment in 2005 (too complicated to explain) and I have a comma delimited text file that is to be appended to the main table. I'd like to pull the last column in the text file out for the first record and use it as select criteria for a delete command. But how can I do this in the older DTS environment?
Here's the line of foobar data
9,36,7890432174,2007-12-17 00:00:00.000,21,15.22,99,11,49,28,2009-07-12 00:00:00
what I want to do is create a sql statement that will delete all the records where a certain column is equal to "2009-07-12 00:00:00"
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 DTS 中至少有两种方法可以实现这一点。
第一种是将
这假设有某种方法可以从数据中识别文本文件中行的顺序。 如果没有,您可以将标识列添加到临时表定义中。
第二种是
EDIT
我相信也可以使用通用文本文件 ODBC 驱动程序来访问文本文件,就像访问数据库表一样。
There are at least two ways to implement this in DTS.
The first is to
This assumes that there is some way to identify the order of the rows in the text file from the data. If not, you could add an identity column to the staging table definition.
The second is to
EDIT
I believe it's also possible to use the generic text file ODBC driver to access the text file like a database table.