Re: Modifying Primary Key Values
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 10/21/04
- Next message: Tibor Karaszi: "Re: RETURN - how do I return a string, not just an integer? Thanks"
- Previous message: simon: "Re: Select question"
- In reply to: ggeshev: "Modifying Primary Key Values"
- Next in thread: David Portas: "RE: Modifying Primary Key Values"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 21 Oct 2004 10:33:42 +0200
You can't. In an RDBMS, you refer to rows by the values in their columns. If you don't have any
reliable value, you are out of luck. Do you have an alternate key you can use for this purpose?
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "ggeshev" <ggeshev@tonegan.bg> wrote in message news:OtU918ztEHA.3088@tk2msftngp13.phx.gbl... > Hello! > > Let's suppose I have a table MyTable (A INT PRIMARY KEY, B VARCHAR(20)). > > > > I send an UPDATE script to sql server. > > In this script I modify the A column /the primary key/. > > In an AFTER UPDATE TRIGGER I would like by analyzing "inserted" and > "deleted" virtual tables to understand which row from "inserted" > corresponds to which row in "deleted". > > You understand that I cannot rely for that purpose on the A column /the > primary key/ because values in it are changed. > > How can I make the true correspondence between "new" and "old" rows? > > > > Thank you! > >
- Next message: Tibor Karaszi: "Re: RETURN - how do I return a string, not just an integer? Thanks"
- Previous message: simon: "Re: Select question"
- In reply to: ggeshev: "Modifying Primary Key Values"
- Next in thread: David Portas: "RE: Modifying Primary Key Values"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|