我在那里我通过Execute SQL
任务插入行表根据病情
我的XML包含像
<ROOT>
<row firstName="Joe" lastName="Blow" city="Seattle" state="WA" phone="555-666-7777"/>
<row firstName="Jane" lastName="Doe" city="Los Angeles" state="CA" phone="566-866-2345"/>
<row firstName="Robert" lastName="Smith" city="Washington" state="DC" phone="444-555-6666"/>
<row firstName="Mary" lastName="Contrary" city="Garden City" state="FL" phone="234-876-9374"/>
<row firstName="Thomas" lastName="Doubter" city="New Orleans" state="LA" phone="384-389-7342"/>
<row firstName="Barbara" lastName="Bologna" city="Chicago" state="IL" phone="483-483-8162"/>
</ROOT>
数据将XML数据转换成记录设置目的地和记录集目标数据库表中的包我已经在我的包装中取出四个变量的所有字符串类型的
firstname,lastname,city,state,phone
现在,我的要求是,我需要这个XML数据插入到我基于名字的目的地表格。
如果我选择了firstname= Robert
,则只有具有该名字的行必须输入到我的目标表中。
而我的执行SQL任务包含
Result set Property--single row
connection type--OLEDB
connection--myconnection
sql statement--declare @firstName varchar(25)
select @firstName= ?
INSERT INTO people_xml (firstName, lastName,city,state,phone)
select firstName,lastName, city,state,phone from people_xml
where [email protected]
Select Convert(varchar,Scope_Identity()) as SourceIDentity
参数映射选项卡
user::firstname
user::lastname
user::city
user::state
user::phone
结果集选项卡
result Name--0
variable Name--User::SourceID
当我运行它抛出一个错误,如
包[Execute SQL Task] Error: Executing the query "declare @firstName varchar(25) select @firstName= ..." failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
缩小的问题 – 2012-01-31 08:22:26
StackOverflow的作品!在一个人们想互相帮助的前提下衡量一个人对某个主题的有用性和感知影响力与他们的声誉有关你已经询问了** [5个其他问题](http://stackoverflow.com/users/) 1025057/satishkumar?tab = questions)**但没有选择答案,也没有提供有用的答案。人们乐于花费精力帮助您找到答案,但您需要成为社区的优秀成员,并奖励他们的努力。投票或反馈,如果他们的解决方案不起作用 – billinkc 2012-01-31 13:26:10