Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQL 2005 view based on linked server table can't be manual..

 
   Database Help (Home) -> Programming RSS
Next:  How to limit OUTER join to a single row?  
Author Message
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 1) Posted: Thu Jan 11, 2007 9:35 am
Post subject: SQL 2005 view based on linked server table can't be manually updated
Archived from groups: microsoft>public>sqlserver>programming (more info?)

Hi everyone!

I have two SQL Server 2005, Server_A and Server_B. On Server_A, I
created a linked server (Server_B). On Server_A, I created a view that
looks like:

CREATE VIEW [dbo].[vwTest] AS
SELECT LastName, FirstName
FROM [Server_B].test.dbo.table_1


The view returns correctly the records. If I execute something like:

UPDATEdbo.vwTest
SETLastName='FF'

it works fine!

But if I open the view and I try to manually change a value (directly
typing in a record), I get an error message that looks like this (my PC
is in french, so it's my own translation) "(..) The operation was
cancelled because the OLE DB 'SQLNCLI' provider from the linked server
'Server_B' wasn't able to start a distributed transaction. (...)"

Anyone has a clue?

Thanks!

 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 2) Posted: Thu Jan 11, 2007 10:08 am
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the info. But where do I start it? In the services panel?


> Try starting MSDTC (distributed transaction coordinator), it seems it isnt
> started.
>
> MC

 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 3) Posted: Thu Jan 11, 2007 11:22 am
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 4) Posted: Thu Jan 11, 2007 11:42 am
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I tried this without success:

SET ARITHABORT ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE VIEW dbo.vwTest
AS
SELECT LastName, FirstName
FROM [CA-MTL-SRV01].test.dbo.table_1

GO

SET ARITHABORT OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 5) Posted: Thu Jan 11, 2007 12:06 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 6) Posted: Thu Jan 11, 2007 12:17 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yeah I know that using QA would be better but to make a long story
short, it would save me a lot, lot of time if I could access directly
to the view as I'm trying to do...
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 7) Posted: Thu Jan 11, 2007 1:07 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Allright got it!

I had to set on my local server, where the view is, the XACT abort
option under the server properties/connections.

Does anyone know if setting this option can cause other problems or if
I can leave it checked without any worry?

Thanks!
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
grosdug

External


Since: Apr 04, 2007
Posts: 11



(Msg. 8) Posted: Thu Jan 11, 2007 1:24 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Wait a minute, I was able to update one row but if I try to update
another row, I get an error message like "You are trying to modify more
than one row."

I can only update one row!!! So close...
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
Scott Morris

External


Since: Aug 28, 2003
Posts: 86



(Msg. 9) Posted: Thu Jan 11, 2007 3:00 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The short answer is not to use SMS or EM to "open" a view or a table for
editing. When using these tools for editing, you have no control over what
exactly the tool does to get the data (or metadata) and how it uses that
information to update the database. Use QA (or a query window in SMS)
instead. If you are curious, you can use the profiler to monitor the
commands that SMS is using.
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
MC

External


Since: Jan 24, 2007
Posts: 38



(Msg. 10) Posted: Thu Jan 11, 2007 6:41 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try starting MSDTC (distributed transaction coordinator), it seems it isnt
started.

MC


wrote in message

> Hi everyone!
>
> I have two SQL Server 2005, Server_A and Server_B. On Server_A, I
> created a linked server (Server_B). On Server_A, I created a view that
> looks like:
>
> CREATE VIEW [dbo].[vwTest] AS
> SELECT LastName, FirstName
> FROM [Server_B].test.dbo.table_1
>
>
> The view returns correctly the records. If I execute something like:
>
> UPDATEdbo.vwTest
> SETLastName='FF'
>
> it works fine!
>
> But if I open the view and I try to manually change a value (directly
> typing in a record), I get an error message that looks like this (my PC
> is in french, so it's my own translation) "(..) The operation was
> cancelled because the OLE DB 'SQLNCLI' provider from the linked server
> 'Server_B' wasn't able to start a distributed transaction. (...)"
>
> Anyone has a clue?
>
> Thanks!
>
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
MC

External


Since: Jan 24, 2007
Posts: 38



(Msg. 11) Posted: Thu Jan 11, 2007 8:18 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Its a service like any other. So yes, you can start it there

MC

wrote in message

> Thanks for the info. But where do I start it? In the services panel?
>
>
>> Try starting MSDTC (distributed transaction coordinator), it seems it
>> isnt
>> started.
>>
>> MC
>
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
MC

External


Since: Jan 24, 2007
Posts: 38



(Msg. 12) Posted: Thu Jan 11, 2007 8:25 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

If I rememmber correctly, you need to set ARITHABORT ON. I believe its set
when you create view (connection property). Can you create test view on
connection with this setting on and then try?


MC


wrote in message

> The service was already started. Any other idea?
>
> Thanks!
>
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
MC

External


Since: Jan 24, 2007
Posts: 38



(Msg. 13) Posted: Thu Jan 11, 2007 8:52 pm
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ufff, my mistake. Try using XACT_ABORT ON. If that doesnt help, all I can
think of is checking MSDTC properties.


MC


wrote in message

>I tried this without success:
>
> SET ARITHABORT ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> SET ANSI_NULLS ON
> GO
>
> CREATE VIEW dbo.vwTest
> AS
> SELECT LastName, FirstName
> FROM [CA-MTL-SRV01].test.dbo.table_1
>
> GO
>
> SET ARITHABORT OFF
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS OFF
> GO
>
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
MC

External


Since: Jan 23, 2007
Posts: 5



(Msg. 14) Posted: Fri Jan 12, 2007 7:55 am
Post subject: Re: SQL 2005 view based on linked server table can't be manually updated [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Read about it in BOL. It all depends on a number of things, mainly how do
you handle errors and transactions. If you need to update more then one row,
I would really suggest that you write a script to do it.


MC


wrote in message

> Allright got it!
>
> I had to set on my local server, where the view is, the XACT abort
> option under the server properties/connections.
>
> Does anyone know if setting this option can cause other problems or if
> I can leave it checked without any worry?
>
> Thanks!
>
 >> Stay informed about: SQL 2005 view based on linked server table can't be manual.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
View SQLServer Linked Server Processes - Hi, Is there a way I can view SQLServer processing steps while it is connecting to a linked server? I'm trying to track down a problem of sporadically not connecting to Linked Server to Access mdb. Thanks. Alan.

Creating a linked server to Timberline from SQL 2005 - Hi all, I have a Timberline construction application that I am trying to link to SQL server 2005 so I can import the data to SQL server for reporting services. I have created the linked server using the below CREATE LINK SERVER below and if I right..

10,000 Feet View - SQL Server 2005 Security - Does anyone know of a hierachical chart which shows at a glance how the securables on a SQL Server 2005 database can be affected. I guess what I am trying to say for example, for server roles, database roles, permissions granted on schemas, and object...

GROUP BY messes up results of view based on UDF !!?! - Hi there, we have a rather strange effect here were a group by on a view does not return the expected results. We managed to nail it down to the fact that the view is based on multiple fields being the result of the same User Defined Function, but..

systypes table SQL Server 2005 - Hi, I used the status field on 'systypes' table for generating the table scripts on sql server 2000. if the status value is zero, then we dont have to specify, the size of the datatype for example, int big int etc. If status = 2, then we need to..
   Database Help (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]