November 3, 2005 at 1:04 pm
I can do an Insert/Select all together in a Stored Proc such as:
INSERT INTO tblReportTemp (EmpName, Emp_Class, Month_ForCount, Month_AgainstCount, Month_CountCalls, Month_ApprovedLeave, Month_Percent)
SELECT EmpName, Emp_Class, Month_ForCountSum, Month_AgainstCountSum, Month_CountCallsSum, Month_ApprovedLeaveSum, Month_Percent
FROM MyView
Is there a way to do a similiar thing with an update such that I update based off of a query?
November 3, 2005 at 1:28 pm
Just like this:
UPDATE tablename
SET columnname = (SELECT columnname FROM tablename WHERE ?????)
WHERE ?????
November 3, 2005 at 1:59 pm
Wow, that takes forever to complete....
November 3, 2005 at 2:00 pm
Look for Update From.
Update mytable
set col1 = somevalue
From SomeTable
Join mytable on somecol = othercol
please present table, data, and your expected results and someone should be able to help
November 3, 2005 at 2:08 pm
Hey thanks that was more in line with what I was looking for. I appreicate the help.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply