I want to retrieve store procedure columns as row without data.
for example I have store procedure SP_Get_All_Country_List with parameter @Return_Data BIT. If I pass Return_Data=1 then it return value but when I pass Return_Data=0 then no data return.
EXEC SP_Get_All_Country_List @Return_Data=0
it show blank columns as :
Country_ID Country_Name Country_Region
Now I want this as :
Country_ID
Country_Name
Country_Region
I don't want data I only want column names as row. simply I want store procedure all columns list.
SQLDatabasesMicrosoft SQL Server
Last Comment
Naitik Gamit
8/22/2022 - Mon
Vitor Montalvão
You'll need to change the SP to act as required.
Jim Horn
afaik this is not possible, especially when a SP can return different sets based on logic in the SP.
HainKurt
add this to sql
select Country_ID, Country_Name, Country_Region from someTable where 1=2UNIONyour existing query here...