Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Update one column of a table with data from another table Expand / Collapse
Author
Message
Posted Wednesday, March 20, 2013 8:00 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 6:29 AM
Points: 590, Visits: 733
Hi,

Try this one


UPDATE bck
SET bck.ProcID = ori.ProcID
FROM dbo.BlogCopy_copy as bck inner join dbo.BlogProcedures as ori
on bck.WebID=ori.WebID



Using aliasses of tables is a good habit that you really should learn to use

Wkr,
Van Heghe Eddy
Post #1433230
Posted Wednesday, March 20, 2013 8:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 20, 2013 8:40 PM
Points: 2, Visits: 10
Thanks for the tip - I did manage to find out why it did not work, I needed to use an additional "WHERE" qualifier.

I also agree with the alias suggestion, but my main platform for development is web based and I use DreamWeaver for that. Using aliases tends to mess with the built in SQL builder, so I have never really spent too much time getting to use aliases.

Thanks
Hans
Post #1433563
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse