Schema from stored procedure

前端 未结 5 1505
迷失自我
迷失自我 2020-12-21 10:30

I have a procedure, I want to read schema of the procedure. To retrieve view schema I use the query shown here. Same way I want to get schema of stored procedure. How to get

5条回答
  •  难免孤独
    2020-12-21 11:05

    This is an answer that does not call the SP - if you do, you may inadvertently affect data:

    SELECT * FROM sys.dm_exec_describe_first_result_set ('owner.sprocName', NULL, 0) ;
    

    This returns the result set :

    is_hidden
    column_ordinal 
    name
    is_nullable 
    system_type_id 
    system_type_name    
    max_length 
    precision 
    scale 
    collation_name      
    user_type_id 
    user_type_database  
    user_type_schema    
    user_type_name      
    assembly_qualified_type_name
    xml_collection_id 
    xml_collection_database
    xml_collection_schema  
    xml_collection_name    
    is_xml_document 
    is_case_sensitive 
    is_fixed_length_clr_type 
    source_server   
    source_database 
    source_schema   
    source_table    
    source_column   
    is_identity_column 
    is_part_of_unique_key 
    is_updateable 
    is_computed_column 
    is_sparse_column_set 
    ordinal_in_order_by_list 
    order_by_is_descending 
    order_by_list_length 
    error_number 
    error_severity 
    error_state 
    error_message 
    error_type  
    error_type_desc
    

提交回复
热议问题