Thursday, March 8, 2012

Cannot update

Hi,
I have the following update statement but using a linked server
Update txq005dev1.sprint.dbo.becinfo set unit = a.unit from becinfo a inner
join txq005dev1.sprint.dbo.becinfo b on a.HRGType = b.HRGType and
a.ChargSubType = b.ChargSubType
I am not sure why it doesn't work. Can I not use Linked server in an Update
Statement?
Thanks
Ed
The following is an error message:
Server: Msg 7306, Level 16, State 2, Line 2
Could not open table '"sprint"."dbo"."becinfo"' from OLE DB provider
'SQLOLEDB'. The provider could not support a row lookup position. The
provider indicates that conflicts occurred with other properties or
requirements.
[OLE/DB provider returned message: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was done.]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IOpenRowset::OpenRowset
returned 0x80040e21: [PROPID=DBPROP_BOOKMARKS VALUE=True
STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_COMMANDTIMEOUT VALUE=600
STATUS=DBPROPSTATUS_OK], [PROPID=Unknown PropertyID VALUE=True
STATUS=DBPROPSTATUS_OK], [PROPID=DBPROP_IRowsetLocate VALUE=True
STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_IRowsetChange VA...What product are you linking to?
ML|||Ed,
Does the LS table have a PK or UNIQUE constraint? If not, might try adding
one and then trying again.
HTH
Jerry
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:154D0BE7-5EDC-4897-A9BD-C7903ABF1165@.microsoft.com...
> Hi,
> I have the following update statement but using a linked server
> Update txq005dev1.sprint.dbo.becinfo set unit = a.unit from becinfo a
> inner
> join txq005dev1.sprint.dbo.becinfo b on a.HRGType = b.HRGType and
> a.ChargSubType = b.ChargSubType
> I am not sure why it doesn't work. Can I not use Linked server in an
> Update
> Statement?
> Thanks
> Ed
> The following is an error message:
> Server: Msg 7306, Level 16, State 2, Line 2
> Could not open table '"sprint"."dbo"."becinfo"' from OLE DB provider
> 'SQLOLEDB'. The provider could not support a row lookup position. The
> provider indicates that conflicts occurred with other properties or
> requirements.
> [OLE/DB provider returned message: Multiple-step OLE DB operation
> generated
> errors. Check each OLE DB status value, if available. No work was done.]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IOpenRowset::OpenRowset
> returned 0x80040e21: [PROPID=DBPROP_BOOKMARKS VALUE=True
> STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_COMMANDTIMEOUT VALUE=600
> STATUS=DBPROPSTATUS_OK], [PROPID=Unknown PropertyID VALUE=True
> STATUS=DBPROPSTATUS_OK], [PROPID=DBPROP_IRowsetLocate VALUE=True
> STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_IRowsetChange VA...
>|||Try this
Update txq005dev1.sprint.dbo.becinfo set unit = (SELECT unit from becinfo a
inner join txq005dev1.sprint.dbo.becinfo b on a.HRGType = b.HRGType and
a.ChargSubType = b.ChargSubType)
if you are sure that inner query results only one value
--
Regards
R.D
--Knowledge gets doubled when shared
"Jerry Spivey" wrote:

> Ed,
> Does the LS table have a PK or UNIQUE constraint? If not, might try addin
g
> one and then trying again.
> HTH
> Jerry
> "Ed" <Ed@.discussions.microsoft.com> wrote in message
> news:154D0BE7-5EDC-4897-A9BD-C7903ABF1165@.microsoft.com...
>
>

No comments:

Post a Comment