Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Unable to update view in Sql Server 2000
Hi,


I have an application that's running fine on development servers (web

and database-sql server 2000). I'm updating a record through a third
party component but I don't think the component is the problem. What's
happening is that I'm updating fields that are part of view. I'm only
updating fields in one table of the view and this works fine in the
development environment.


What happens in the production environment when I try to update
(using the third party component) I get the following message:


"Current recordset does not support updating. This may be a limitation
of the provider or of the selected locktype."


As an experiment I took the same code but removed the view, leaving
only the table I want to update as the record source. In that case the
update worked. So it seems that something in the production database
doesn't like me updating a view. However I can do that in the database
in the development environment.


The third party component is dbnetgrid which works fine in the
development environment. I can only conclude it's something about the
database that prevents me from updating this same table if it's in a
view. I've talked to our DBA but he says there's no difference between
the databases. Any ideas would be appreciated.


Neil


Report this thread to moderator Post Follow-up to this message
Old Post
fig000
10-27-05 02:25 PM


Re: Unable to update view in Sql Server 2000
In Standard SQL, an updatable view has to be built on one table and has
to include a key.  The idea is that a row in the VIEW maps to one and
only one row in the base table.  It is very restricted.

Some vendors allow for more power than that, but this is not uniform or
well-defined. The real problem is that the question of view updatablity
is known to be undecidable.

What you have as a portable, standard way to handle a multi-table view
update is an INSTEAD OF trigger.  You can look up the SQL Server
version in BOL.


Report this thread to moderator Post Follow-up to this message
Old Post
--CELKO--
10-27-05 02:25 PM


Re: Unable to update view in Sql Server 2000
fig000  (neilnewton001@yahoo
.com)  writes:
>   I have an application that's running fine on development servers (web
> and database-sql server 2000). I'm updating a record through a third
> party component but I don't think the component is the problem. What's
> happening is that I'm updating fields that are part of view. I'm only
> updating fields in one table of the view and this works fine in the
> development environment.
>
>
>   What happens in the production environment when I try to update
> (using the third party component) I get the following message:
>
>
> "Current recordset does not support updating. This may be a limitation
> of the provider or of the selected locktype."
>
>
>   As an experiment I took the same code but removed the view, leaving
> only the table I want to update as the record source. In that case the
> update worked. So it seems that something in the production database
> doesn't like me updating a view. However I can do that in the database
> in the development environment.
>
>
>   The third party component is dbnetgrid which works fine in the
> development environment. I can only conclude it's something about the
> database that prevents me from updating this same table if it's in a
> view. I've talked to our DBA but he says there's no difference between
> the databases. Any ideas would be appreciated.

Unfortunately, this is difficult to answer without knowledge about
the submitted queries and the view and table definitions.

I guess the component submits the queries. To see what that is, you
cam use Profiler. However, this requires sysadm privileges, which I
assume that you don't have.

To compare the view table definitions, you can use sp_help, or script
them from Query Analyzer. Give particular attention to keys.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp


Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
10-27-05 02:25 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 03:33 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006