Open delsehi opened 1 year ago
I tried modifying my stored procedure as
ALTER procedure [app].[get_user]
(
@user_id NVARCHAR(MAX)
)
AS BEGIN
DECLARE @result NVARCHAR(MAX)
DECLARE @user_id_modified NVARCHAR(MAX)
-- Remove added "" from Tiberius
SET @user_id_modified = REPLACE(@user_id, '"', '')
SET @result = (select top 1
*, @user_id as 'userid'
from app.[user]
where [id] = @user_id_modified
for json auto)
-- select @result 'result'
select isnull(@result, '[]') 'result'
END
And now it worked. But I would prefer not having to strip out quotation marks in my sps in order to use Tiberus... 🥺
I cannot get the results back from a stored procedure. It seems like when I bind a string value to a parameter, it adds quotation marks "" around the string.
This prints
RESULT: ["id": "5sXc[.... the rest of the user id ]Ac-E"
And not the actual user which is in the database.
Executing
in the database returns the right result though.
Are there any examples of how to bind a string as a parameter to a stored procedure or is this a bug?
I am using SQL Server in a local Docker container and Tiberius 0.12.1.