paul.hartland at fsmail.net
paul.hartland at fsmail.net
Thu Apr 1 02:14:46 CST 2004
To all, I have a Visual Basic 6 front-end together with a SQL Server 7.0 back-end, and have tried writing a stored procedure to do the following: I pass a UserID into the SP, then I want the SP to UPDATE tblPersonnelJobCategories to TRUE where tblPersonnelJobCategories.UserID is equal to the UserID that I passed to the SP but I only want the UPDATE to take place where the PayrollNo & CategoryID in tblPersonnelJobCategories matches the PayrollNo & CategoryID in tblPersonnelCategoriesSelected I tried using the follwing SQL statement in my SP but it doesnt like the Inner Join: UPDATE tblPersonnelJobCategories INNER JOIN tblPersonnelCategoriesSelected ON (tblPersonnelJobCategories.CategoryID = tblPersonnelCategoriesSelected.CategoryID) AND (tblPersonnelJobCategories.PayrollNo = tblPersonnelCategoriesSelected.PayrollNo) SET tblPersonnelJobCategories.Selected = True WHERE tblPersonnelJobCategories.UserID= @UserId Any help would be greatly appreciated, as Im fairly new to SPs and thought an INNER JOIN would be ok. Thanks in advance for any help Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month www.freeserve.com/anytime