EXEC [dbo].[pr_cfgAddFact]
@SettingName = 'TransferBatch',
@RoleFK = SELECT TOP 1 rolepk FROM cfgRole WHERE cfgRole.Name = 'SuperAdmin'
Why would SQL complain about the SELECT clause here? I am trying to run the proc with the sub query getting the data.
try this:
you can not have the query within the EXECUTE of the procedure, parameters to stored procedures do not allow this. first, select the value into a local variable first and then pass that local variable in to the stored procedure.
stored procedure parameters may only be values, @variables or the keyword
DEFAULT, that means that queries and expressions ore not permitted.EXECUTE (Transact-SQL)