You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 24, 2022. It is now read-only.
@@ -802,6 +813,11 @@ static int GetDatatypeSize(string type)
802
813
// Edit here to get a method to read the proc
803
814
class SqlServerSchemaReader : SchemaReader
804
815
{
816
+
private bool IncludeSPReturnTypes;
817
+
public SqlServerSchemaReader(bool includeSPReturnTypes)
818
+
{
819
+
IncludeSPReturnTypes = includeSPReturnTypes;
820
+
}
805
821
// SchemaReader.ReadSchema
806
822
807
823
@@ -884,6 +900,7 @@ class SqlServerSchemaReader : SchemaReader
884
900
foreach (var sp in result)
885
901
{
886
902
sp.Parameters=LoadSPParams(sp);
903
+
if (IncludeSPReturnTypes) sp.SPOutputColumns = LoadSPOutputColumns(sp);
887
904
}
888
905
return result;
889
906
}
@@ -969,6 +986,37 @@ class SqlServerSchemaReader : SchemaReader
969
986
}
970
987
}
971
988
989
+
List<SPOutputColumn> LoadSPOutputColumns(SP sp)
990
+
{
991
+
var result=new List<SPOutputColumn>();
992
+
using (var cmd=_factory.CreateCommand())
993
+
{
994
+
cmd.Connection=_connection;
995
+
cmd.CommandText=string.Format(@"SELECT name,CAST(is_nullable as VARCHAR(1)) is_nullable,system_type_name FROM sys.dm_exec_describe_first_result_set_for_object(OBJECT_ID('{0}'), 1)",sp.SchemaQualifiedName);
0 commit comments