Reputation: 3116
Why is the first statement a syntax error?
-- this does not work: "incorrect syntax near the keyword 'system_user'"
exec dbo.spEmployee_GetRecords @pLoginName = system_user
-- this works
declare @p nvarchar(30);
select @p=system_user
exec dbo.spEmployee_GetRecords @pLoginName = @p
(SQL Server 2005 Express Edition)
Upvotes: 1
Views: 1044