VBBRett
asked on
Creating Values in stored procedures
I would like to create values inside stored procedures and assign them to certain variables in the stored procedure. how would I do that?
or with aggregations:
select @sumval = sum(somefield) from tablename
or from a function
select @value = dbo.udf_functionname()
get current date
select @date = getdate()
get current user
select @currentuser = suser_sname()
select @sumval = sum(somefield) from tablename
or from a function
select @value = dbo.udf_functionname()
get current date
select @date = getdate()
get current user
select @currentuser = suser_sname()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT @Variabl2 = SomeCOlumn
FROM SomeTable
WHERE someCondition