Azure的网站的NodeJS无法连接到具有不同于默认排序规则SQL数据库 [英] Azure nodejs site cannot connect to SQL DB that has a collation different than the default

查看:210
本文介绍了Azure的网站的NodeJS无法连接到具有不同于默认排序规则SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个简单的页面的NodeJS http://pastebin.com/HxMsHBbg

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 ");
});

在SQL_CONN是MSSQL数据库与整理 - 说 - Greek_CI_AI,然后我得到的错误

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

HRESULT:0x6d
HTTP状态:500
HTTP原因:内部服务器错误

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?

推荐答案

这个问题已经解决了,看的这里

The issue has been resolved, see here

这篇关于Azure的网站的NodeJS无法连接到具有不同于默认排序规则SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆