I have the field, stampAvg, which is based on the current maximum of another column. The function to create the new stampAvg is as follows
SELECT MAX(stmScore)*1.25 AS stampAvg FROM tblStamp
That's it.
Now enter my stored procedure...
Expand|Select|Wrap|Line Numbers
- CREATE PROCEDURE spSetStamp
- @name varchar(50)
- @score float
- @stamp float
- AS
- SET @stamp AS EXECUTE (SELECT MAX(stmScore)*1.25 AS stampAvg FROM tblStamp)
- INSERT INTO tblStamp (stmName,stmScore,stmStamp)
- VALUES(@name,@score,@stamp)
- GO
SET @stamp AS EXECUTE (SELECT MAX(stmScore)*1.25 AS stampAvg FROM tblStamp)
Is incorrect