Re: How Can i Update many fields by using SQL
From: Agnes (agnes_at_dynamictech.com.hk)
Date: 02/16/05
- Next message: Steve Kass: "Re: Delete from takes a very, very long time"
- Previous message: Dan Guzman: "Re: How Can i Update many fields by using SQL"
- In reply to: Dan Guzman: "Re: How Can i Update many fields by using SQL"
- Next in thread: Babu M.K: "Re: How Can i Update many fields by using SQL"
- Reply: Babu M.K: "Re: How Can i Update many fields by using SQL"
- Reply: Hugo Kornelis: "Re: How Can i Update many fields by using SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Feb 2005 12:54:27 +0800
OH, I need to update myInvtable indeed. update the information from the
companytable
Can I
update myinvTable
set companyadd1 = myCompanyTable.companyadd1,
companyadd2 = myCompanyTable.companyadd2,
.....etc
where .. myInvTable.companycode = myCompanyTable.companycode ???
Thanks
"Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> ¼¶¼g©ó¶l¥ó·s»D:OZroCL%23EFHA.1936@TK2MSFTNGP14.phx.gbl...
> You can update only one table at a time in a single Transact-SQL
> statement. It is unclear from your post what columns belong to which
> tables. Single table UPDATE example:
>
> UPDATE myCompanyTable
> SET
> CompanyAdd1 = 'address 1',
> CompanyAdd2 = 'address 2',
> CompanyAdd3 = 'address 3',
> CompanyAdd4 = 'address 14',
> CompanyTel = 'tel 1',
> CompanyFax = 'fax 1',
> CompanyContact' = 'contact 1'
> WHERE myCompanyTableID = 1
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>
> "Agnes" <agnes@dynamictech.com.hk> wrote in message
> news:%23U2uIF%23EFHA.1408@TK2MSFTNGP10.phx.gbl...
>>I got myInvTable, myCompanyTable,
>> I need to update
>> CompanyAdd1,CompanyAdd2,CompanyAdd3,CompanyAdd4,CompanyTel,CompanyFax,CompanyContact.
>> How can I write it by one SQL statment ??
>> Thanks a lot
>>
>
>
- Next message: Steve Kass: "Re: Delete from takes a very, very long time"
- Previous message: Dan Guzman: "Re: How Can i Update many fields by using SQL"
- In reply to: Dan Guzman: "Re: How Can i Update many fields by using SQL"
- Next in thread: Babu M.K: "Re: How Can i Update many fields by using SQL"
- Reply: Babu M.K: "Re: How Can i Update many fields by using SQL"
- Reply: Hugo Kornelis: "Re: How Can i Update many fields by using SQL"
- Messages sorted by: [ date ] [ thread ]