You need to set some field as a primary key. The most common way to do
this in SQL Server would be to use an INT field with IDENTITY set.
Alternatively, you could use a UUID or some other text field. We have a
CMS here that uses unique varchar fields to identify nodes in the tree
(i.e. pages). Many would argue that even in a case like this, you should
use a numeric primary key.

Matthew Walker
http://www.matthewwalker.net.nz/

        


> -----Original Message-----
> From: Ed Gordon [mailto:NetDr@;callptc.com]
> Sent: Friday, 8 November 2002 7:26 a.m.
> To: CF-Talk
> Subject: SQL UPDATE - identifying a record?
> 
> 
> How does one <CFQUERY> UPDATE a particular record on an SQL 
> database? That
> is the general question...
> 
> It may sound simple, but if you were to read a record using 
> SELECT, if more
> than one record matched the criteria in a WHERE clause, how 
> could you UPDATE
> just one of them?
> 
> I have been using UUID on EVERY record in every table in 
> order to alleviate
> this. It gives me a unique value for each record (row) and 
> therefore I can
> say WHERE uuid='#the-uuid-I-read#'
> 
> But without this technique - is there a record-number 
> accessible or anything
> like that?
> 
> Ed G.
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to