Azure nodejs site cannot connect to SQL DB that has a collation different than the default

感情迁移 提交于 2019-12-23 05:58:07

问题


I have this simple nodejs page http://pastebin.com/HxMsHBbg

/**
 * Module dependencies.
 */

var express = require('express'),  
    http = require('http'),
    url = require('url'),
    util = require('util');


var nconf = require('nconf');
var sql = require('node-sqlserver');    


nconf.env();
var conn = nconf.get("SQL_CONN");   
var app = express();

app.get('/', function(req, res){
    var qs = url.parse( req.url, true );        
    res.writeHead(200, {'Content-Type': 'application/json; charset=utf-8'});

    var alldata={}; 

    var select = "SELECT 1";
    sql.query(conn, select, function(err, items) {

        res.end(JSON.stringify(alldata));       
    });



});
http.createServer(app).listen(process.env.PORT || 3000, function(){
  console.log("Express server listening ");
});

When SQL_CONN is a MSSQL DB with a collation - say - Greek_CI_AI , then I get the error

HRESULT: 0x6d HTTP status: 500 HTTP reason: Internal Server Error

If the database in in the default collation, then there is no problem. Does anyone have a solution or is it a bug?


回答1:


The issue has been resolved, see here



来源:https://stackoverflow.com/questions/12216003/azure-nodejs-site-cannot-connect-to-sql-db-that-has-a-collation-different-than-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!