sql server - Column name or number of supplied values does not match table definition during execution plan on -
currently facing issue when executing stored procedure keeping include actual execution plan - on. otherwise stored procedure executing fine , returning results expected. reason kind of behavior?
i have went through links error different here occurs when have kept include actual execution plan - on. link1 link2
sample code (proc1) -
create procedure proc1 (blah blah blah) begin begin try ------------- code -------------- -----issue code----- insert #temptable (col1,col2,.....) execute proc2 ------------- code -------------- end try begin catch --------- raiserror(............); end catch end
sample code (proc2) -
create procedure proc2 begin begin try --------------- code --------------- select col1,col2,col3,..... #innersptemptable end try begin catch -------------------- raiserror(); -------------------- end catch end
note: proc2
returns exact same number of columns have taken care while inserting #temptable
do let me know if further information required.
environment -
microsoft sql server 2014 - 12.0.2000.8 (x64) feb 20 2014 20:04:26 copyright (c) microsoft corporation enterprise edition (64-bit) on windows nt 6.1 <x64> (build 7601: service pack 1)
edit1: when error occurs in proc1 , captured, noted error_procedure()
return value of proc2 again proc2 runs fine , gives results expected , without include actual execution plan kept on.
edit2: when replaced local temp table global temp table (the temp table talking used pass result set proc2) inside proc2 execution of proc1 happened successfully.
edit3: when removed try-catch block inner sp (proc2) , executed proc1 keeping include actual execution plan - on no errors reported , execution completed successfully.
Comments
Post a Comment