February 7, 2012 at 4:46 pm
I tried to excute a stored procedure, but it gives the sysntax error on the last line
EXECUTE @rc = [Assignment].[dbo].[sps_schSchoolRangeProgram_Insert]
@SchoolYear=2012
,@SchoolID=972
,@RangeCd='PS'
,@ProgramID=29
,@CreatedBy=SYSTEM_USER
Incorrect syntax near the keyword 'System_User'.
What could be wrong? if I change a specific username, it is correct.
February 7, 2012 at 4:53 pm
You cannot use Functions as direct input parameters. Initialize it to a variable and use it as an input parameter
February 7, 2012 at 5:10 pm
Can you please make an example?
Thanks
February 7, 2012 at 5:16 pm
here
Use tempdb
GO
create proc getsthedate @dateval datetime
as
select @dateval ;
GO
declare @d datetime = getdate()
exec getsthedate @dateval = @d;
exec getsthedate @dateval = getdate() ;
drop proc getsthedate;
February 7, 2012 at 11:46 pm
Another option would be to have SYSTEM_USER as the default for the column.
February 8, 2012 at 10:43 am
Thank you all!
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply