sql - Stored procedure to table variable issue -


What I'm trying to do is take the result from a stored procedure and put them in a temporary table ...

looks like this:

  DECLARE @Table TABLE ([ID] int, [costA] real, [costB] real, [costC] real INSERT @Table EXECUTE [DBO] [Costprocedure] @ RoutID = 123 @ rate = 20 - from: Select * to Settable - Gives me: ID Costa Cost B Costs 10 0 - However Expert [DBO]. [Costprocedure] @ Root id = 123 @ rate = 20 - GVEEEE ID Costa Costbolic Cost 1.0 1.0 9 8 9 0.9837 0.65463  

So my question is, because the stored procedure is clearly visible Reasonable results are returning from, so when I insert them, insert only the first column of the result in a table variable and give all the zeros in the later column? Is there a known problem about this which I do not know? I also tried:

  INSERT @Table ([ID], [Costa], [Costbie], [Costs] execute [DBO]. [Costprocedure] @ RoutID = 123 @ rate = 20  

This same result was found ... ... I also tried a throwback, and tried a temporary table (table # Too) ... Still the same result ... what am I missing?

I'm just thinking ... if there is a stored processing inside the cost process which writes a price for the floating table, as above, maybe there are some limitations, the number of levels that you nest Can you write process writing in temp tables?

There may be a weird data conversion issue, whether stored functionality defines REALs like your table , Or do they define NUMERIC or other things?

Ensure that datatypes are compatible.

You can do some testing using something like this:

  SELECT SQL_VARIANT_PROPERTY (cast (12345.6789 AS decimal (9, 4)) + cast (5.678912 Select AS Base (9, 6), select 'Base Type', SQL_VARIANT_PROPERTY (CAST), select 'Sql_VierAnPRFTe (cast (12345.678 9 AS decimal (9 4)) + cast (5.678912 AS decimal (9, 6)),' Precision ' (12345.6789 AS Decimal (9 4)) + Cast (5.678912 AS Decimal (9, 6)), 'Scale')  

You were shown what exactly is being returned (A Change the "cast (12345.6789 AS decimal (94)" with returned column value. Just try these values ​​with the stored procedure and match with the table of your table, then give a try


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -