I don't understand the nature of T-SQL select statements inside stored procedures. I come from the Oracle side and here it's for me well defined.
Hope this sample show my misunderstandings!
I have this stored procedure:
create procedure demo_1
as
begin
select count(1) from sys.tables;
end;
Now I can execute this procedure for example via management studio.
exec demo_1
I'll get a nice result within management studio. this look well as person before the computer, but when I call this stored procedure via an 2nd stored procedure I can't do anything with this result.
I don't understand the idea behind this. print a not defined result to an console without any possibility to work inside the TSQL world.
The background for this is: I need a stored procedure which call the internal sp_fkeys
procedure. after some hours of research I don't find a straight forward way to get the information from sp_fkeys
and work with the result inside TSQL.
sp_fkeys
proc i have to create a with temp tbl with many cols to get only one cole. further, when ms change with a new release from sql server the cols from internal sql the code don't work. i don't understand the not existing contracting – oas_public Jul 30 '15 at 14:50