VB脚本将数据从Excel文件加载到SQL表。 [英] VB script to load data from Excel file to SQL table.
问题描述
我有一个excel文件只有两个字段,Email和Source。
I have one excel file having only two fields, Email and Source.
我必须编写VB代码将此文件加载到Microsoft SQL Server表中。表已经存在且它有很多字段但我只想将这两个字段添加到该表中,其他字段保持为空。
I have to write VB code that load this file into Microsoft SQL Server table. Table is already there and it has many fields but I just want to add these two fields into that table keeping other fields null.
还有一件事是我有另一个名为Source Table的表,所以我必须检查这个excel文件中的Source(字段)是否存在于Source表中,如果不,我还想将这个新源(字段值)添加到源表中。所以这些是我想用VB做的
2作品,因为我有一个SSIS包,这是该SSIS包的一部分。我在VB形式的脚本任务中有一个代码,我必须在VB脚本中添加这个新逻辑。
And one more thing is I have another table Called Source Table so I have to check that Source(field) coming in this excel file is there in that Source table and if no then I also want to add this New Source(field value) into Source table. So these are the 2 works I want to do using VB as I am having one SSIS package and this is one part of that SSIS package. I have one code in Script task in form of VB and I have to add this new logic in that VB script.
所以请帮助我,因为我没有VB脚本的经验。
So please me help me in this as I don't have experience in VB scripting.
感谢您提前帮助。
Vicky
推荐答案
如果你正在使用SSIS,那么我认为你的意思并不是说"VB脚本"。 - 这与VB.Net完全不同。
If you are using SSIS then I don't think you mean to say "VB Script" - that's something quite different from VB.Net.
我相信你需要使用
SSDT 用于您的开发。 这些论坛位于:
I believe you'll need to use SSDT for your development. Those forums are located here:
http ://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum = ssdt
我们可以在这里帮助您解决VB特有的问题语言,但构建一个SSIS包将是SQL论坛的主题。
We could assist you here with questions specific to the VB language, but building an SSIS package would be a topic for the SQL forum.
这篇关于VB脚本将数据从Excel文件加载到SQL表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!