Hello.I guess this question aslo concerns regular stored procedures.Let say I perfrom such command on the SQL Server:exec master..MyProcedureThis procedure returns a row with 3 values such as:Result ResultMSG Handle 0 It is ok. 25
Now I would like to assign those values to a variables or insert them to the table, but I am having problem with constructing a proper Query.for example if I create a temporary table:CREATE TABLE dbo.#tmpTable( tmpResult varchar(255), tmpResultMSG varchar(255), tmpHandle varchar(255))
And then:INSERT INTO dbo.#tmpTable exec master..MyProcedure
I get error that the result would be truncated. (I am sure that all the returned values from the procedure are the character strings type, thats why I've constructed tmpTable with varchars.)How to trunc returned values to avoid such error?And how to assign a return value to a variable?Such command doesn't work: DECLARE @MyVariavle varchar(255) SELECT @MyVariable = Result FROM exec master..MyProcedure
I just don't know how to construct a proper command ;)Thanks for your time.