I need help to return the ‘xmlstring’ (varchar(MAX)) from a Stored Procedure. It works fine if I test to count the number of ‘xmlstring’, but how do I get the actual string returned insted?
ALTER PROCEDURE dbo.sp_test
AS
DECLARE @Ret int
SELECT @Ret = COUNT(xmlstring) FROM database WHERE (id = 1)
RETURN @Ret
I wan’t to do something like this, but it’s not correct:
ALTER PROCEDURE dbo.sp_test
AS
DECLARE @Ret varchar(MAX)
SELECT @Ret = TOP (1) xmlstring FROM database WHERE (id = 1)
RETURN @Ret
Yeah something like that:
You don’t need a return unless it’s a function
The select statement will be returned, and you can put more than one, those are call ResultSet