If CompanyID is a unique Field in this table, then you can not update
it by using the same number multiple times.

if it is a number field or text field which the table does not have a
primary key to disallow multiples then you are ok.

>>> [EMAIL PROTECTED] 11/26/02 10:29AM >>>
OK, I tried asking this on SQL Team and nobody understood. I want to
populate a new column in my tblBusiness called companyid. If there are
5
records for "Publix" I want all 5 to have the same companyid. I could
do it
using CF very easily like this:
<cfquery name="Q1" datasource="FL100">
        SELECT    distinct company AS company
        FROM      tblBusiness
</cfquery>

<cfoutput query="Q1">
        <cfquery name="Q2">
                UPDATE tblBusiness
                SET companyid = #currentrow#
                WHERE company = '#company#'
        </cfquery>
</cfoutput>

My question is how ccan I do this in query analyzer. I'm sure you can
create
loops and variables in an SQL script, I just don't know how.
***Sterling Financial Investment Group, Inc. (SFIG) is a member of
NASD/MSRB/NFA/SIPC.  Email transmissions may be monitored.  SFIG
cannot
accept orders to buy or sell via email.  Please visit
www.mysterling.com for
more information.***

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to