Re: add a Primary Key (or something like that) to a View
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 12/21/04
- Next message: metoonyc: "Re: intra-query parallelism"
- Previous message: nivek: "Remote stored procedure"
- In reply to: DraguVaso: "add a Primary Key (or something like that) to a View"
- Next in thread: DraguVaso: "Re: add a Primary Key (or something like that) to a View"
- Reply: DraguVaso: "Re: add a Primary Key (or something like that) to a View"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 17:17:41 +0100
I would assume that Access would pick up the underlying table's primary key definition. Do you have
such?
You can't define a PK on a view as the view doesn't store any data in itself. You can, in some
cases, make the view with SCHEMABINING and create a unique index on the view. The question is, of
course, whether Access would pick up on that. But that is a question for the Access experts.
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "DraguVaso" <pietercoucke@hotmail.com> wrote in message news:Opndze35EHA.3828@TK2MSFTNGP09.phx.gbl... > Hi, > > I have a View like this in my SQL Server 2000: > CREATE VIEW vw_oas_linkhead > AS > SELECT * > FROM oas_linkhead > WHERE (cmpcode = SUSER_SNAME()) > WITH CHECK OPTION > > The problem is: When, inside an Access-applciation, I put a link to this > View, I can't delete records from the View unless I have a Primary Key > defined on the View. > > I can define that Primary Key in Access, but when I refresh the Linked Table > (View) the Primary Key disspaears. This doesn't happen when the Table itself > has a Primary Key on the SQL Server. So I wouldl ike to know if there is a > possiblity to put a Primary Key on a View in Sql Server (I thought this > isn't possible?) or to kind of simulate this on another way (with a check > constraint, ... ?)? > > Does anybody has any idea? > > Thanks a lot! > > Pieter > >
- Next message: metoonyc: "Re: intra-query parallelism"
- Previous message: nivek: "Remote stored procedure"
- In reply to: DraguVaso: "add a Primary Key (or something like that) to a View"
- Next in thread: DraguVaso: "Re: add a Primary Key (or something like that) to a View"
- Reply: DraguVaso: "Re: add a Primary Key (or something like that) to a View"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|