You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The variable $param contains the right value, but when SQLPage tries to execute the stored procedure, it tries to cast the parameter. However, SQL Server (2017) doesn't allow expressions in the EXECUTE statement, and SQLPage returns the following error:
In "test.sql": The following error occurred while executing an SQL statement:
Error returned from database: Incorrect syntax near '@p1'.
The SQL statement sent by SQLPage was:
EXECUTE Test.dbo.TestStoredProcedure CAST(@p1 AS VARCHAR(MAX));
The error is different from what was reported here: #655
Is there a way to put the $param value in a SQL Server variable before the execution of the stored procedure?
I've tried the following, but it doesn't work:
SELECT'table'AS component;
SET @p VARCHAR(MAX) = $param;
EXEC Test.dbo.TestStoredProcedure @p;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to execute a SQL Server stored procedure with a parameter:
The variable $param contains the right value, but when SQLPage tries to execute the stored procedure, it tries to cast the parameter. However, SQL Server (2017) doesn't allow expressions in the EXECUTE statement, and SQLPage returns the following error:
The error is different from what was reported here: #655
Is there a way to put the $param value in a SQL Server variable before the execution of the stored procedure?
I've tried the following, but it doesn't work:
Beta Was this translation helpful? Give feedback.
All reactions