Chuck,
I did find a solution for your bag of tricks:
Alter Procedure "mySPName"
As
set nocount on
UPDATE
tblName
SET
tblName.FieldOne = tblNameTEMP.FieldOne,
tblName.FieldTwo = tblNameTEMP.FieldTwo,
tblName.FieldThree = tblNameTEMP.FieldThree,
FROM
tblNameTEMP
WHERE
tblName.UniqueID = tblNameTEMP.UniqueID
lq
"Chuck Conover" <cconover@commspeed.net> wrote in message news:<1075236614.188548@news.commspeed.net>...
> Lauren,
> That's an interesting update. I've never done an update with a JOIN in
> it before and, out of curiosity, I tried to make it work, but was
> unsuccessful.
> The way I would normally do this in an SP would be like this:
>
> create procedure update_mytable as
> begin
> UPDATE tblMyTable
> set myField = (select t.myField from tblMyTableTemp t where t.UniqueID =
> tblMyTable.UniqueID),
> myField2 = (select t.myField2 from tblMyTableTemp t where t.UniqueID =
> tblMyTable.UniqueID),
> myField3 = (select t.myField3 from tblMyTableTemp t where t.UniqueID =
> tblMyTable.UniqueID)
> end
>
> Since my solution requires 3 trips to tblMyTableTemp, if anyone knows how to
> do this update in a similar fashion to the way Lauren did it below, pls
> advise. I'd love to add that to my "bag o' tricks".
>
> Thanks and Hope that helps.
> Chuck Conover
> www.TechnicalVideos.net
>
>
>
>
> "Lauren Quantrell" <laurenquantrell@hotmail.com> wrote in message
> news:47e5bd72.0401271014.6a478253@posting.google.c om...
> > In VBA, I constructed the following to update all records in
> > tblmyTable with each records in tblmyTableTEMP having the same
> > UniqueID:
> >
> > UPDATE
> > tblMyTable RIGHT JOIN tblMyTableTEMP ON tblMyTable.UniqueID =
> > tblMyTableTEMP.UniqueID
> > SET
> > tblMyTable.myField = tblMyTableTEMP.myField,
> > tblMyTable.myField2 = tblMyTableTEMP.myField2,
> > tblMyTable.myField3 = tblMyTableTEMP.myField3
> >
> > How is this done in a SQL Server Stored Procedure?
> > Any help is appreciated.
> > lq