Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Danny Penrose 7 posts 37 karma points
    Sep 14, 2015 @ 22:17
    Danny Penrose
    0

    Stored procedure to temp table - Patapoco

    Evening,

    I'm trying to exec a stored procedure into a temporary table so i can join some bits from another table.

    Obviously the ideal solution would be to add the join into the SP however this is currently not an option.

    Here's what i'm trying to run in my controller action:

    db.Query<HomeLatestTradesViewModel>(Sql.Builder
    .Append("INSERT INTO #tmp_trade")
    .Append("EXEC get_trade_data_latest")
     );
    

    Which hits me with:

    Invalid object name 'HomeLatestTradesViewModel'.
    

    I believe this is because i need a ; before the EXEC however that just throws an error telling me it shouldn't be there!

    Any help getting this to work is appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft