Re: Modifying Primary Key Values

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 10/21/04


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!
>
>


Relevant Pages

  • Re: Modifying Primary Key Values
    ... >I send an UPDATE script to sql server. ... >You understand that I cannot rely for that purpose on the A column /the ... (Remove _NO_ and _SPAM_ to get my e-mail address) ...
    (microsoft.public.sqlserver.programming)
  • Re: Connection to a MS SQL Server Table (newbie)
    ... > machines with IIS and MS SQL Server. ... The latter seems to defeat the purpose of a password. ... > What I am guessing at this point is that a SQL server account needs to be ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL SERVER
    ... SQL Server is manly used to store data in a relational way (but it's still ... > purpose. ...
    (microsoft.public.sqlserver.msde)
  • Re: More than one index on a table
    ... I know we hate this kind of answer, ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... > I have a table with 100 million rows and have a unique> clustered index on name, date which serves its purpose. ...
    (microsoft.public.sqlserver.server)