pekim/tedious — Issue #8: No row returned from Ordered Query in Stored Procedure 
Author: baoshan
Created: 2012-01-19 06:03:19+00:00
State: open

```sql
ALTER PROC dbo.sp1
AS
SELECT
CityID
FROM dbo.Cities
ORDER BY CityID;
```

Cauese no row returned, while removing the ORDER BY line turns okay.

```javascript
var Connection = require('tedious').Connection;
var Request = require('tedious').Request;

var config = {
userName: 'sa',
password: 'sapass',
server: '192.168.32.151',
options: {
database: 'db'
}
};

var connection = new Connection(config);

connection.on('connect', function(err) {
// If no error, then good to go...
console.log('connection established');

request = new Request("exec dbo.sp1;", function(err) {
console.log(err);
});

request.on('row', function(columns) {
columns.forEach(function(column) {
console.log(column.value);
});
});

request.on('done', function(rowCount, more) {
console.log(rowCount + ' rows returned');
});

connection.execSql(request);

});
```