This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed
tests/ServiceStack.OrmLite.Tests Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,41 @@ WHILE @i < @Times
118
118
Assert . That ( results . Sum ( ) , Is . EqualTo ( expected ) ) ;
119
119
}
120
120
121
+ [ Test ]
122
+ public void Can_SqlList_StoredProc_returning_StringColumn ( )
123
+ {
124
+ var sql = @"CREATE PROCEDURE dbo.DummyColumn
125
+ @Times integer
126
+ AS
127
+ BEGIN
128
+ SET NOCOUNT ON;
129
+
130
+ CREATE TABLE #Temp
131
+ (
132
+ Name nvarchar(30) not null
133
+ );
134
+
135
+ declare @i int
136
+ set @i=1
137
+ WHILE @i < @Times
138
+ BEGIN
139
+ INSERT INTO #Temp (Name) VALUES (CAST(NEWID() AS nvarchar(30)))
140
+ SET @i = @i + 1
141
+ END
142
+
143
+ SELECT * FROM #Temp;
144
+
145
+ DROP TABLE #Temp;
146
+ END;" ;
147
+ db . ExecuteSql ( "IF OBJECT_ID('DummyColumn') IS NOT NULL DROP PROC DummyColumn" ) ;
148
+ db . ExecuteSql ( sql ) ;
149
+
150
+ // This produces a compiler error
151
+ var results = db . SqlList < string > ( "EXEC DummyColumn @Times" , new { Times = 10 } ) ;
152
+ results . PrintDump ( ) ;
153
+ Assert . That ( results . Count , Is . EqualTo ( 10 ) ) ;
154
+ }
155
+
121
156
[ Test ]
122
157
public void Can_SqlList_StoredProc_returning_Scalar ( )
123
158
{
@@ -148,5 +183,7 @@ SELECT @Times AS Id
148
183
Assert . That ( result , Is . EqualTo ( expected ) ) ;
149
184
}
150
185
186
+
187
+
151
188
}
152
- }
189
+ }
You can’t perform that action at this time.
0 commit comments