Unfamiliar syntax - Query with Parameters in Braces at the beggining
5
I have run sp_WhoIsActive on one of our servers using the following syntax: sp_whoisactive @get_plans = 1, @show_sleeping_spids = 0, @get_outer_command = 1, @get_locks = 1 and found a spid with the sql_command (the column shown when @get_outer_command is set to 1) as follows (@p1 int,@p2 int) Exec MyDatabase.MyProc @p1 @p2 When I try to run a query with this syntax on my test Adventureworks database: (@be int) SELECT * FROM Person.Person WHERE BusinessEntityID = @be I get the error Msg 1050, Level 15, State 1, Line 1 This syntax is only allowed for parameterized queries. Msg 137, Level 15, State 2, Line 4 Must declare the scalar variable "@FN". so it seems to be something to do with parameterized queries. This makes sense as the variable @be is never set to a value