Tag: azure sql database

如何从Node中将表值参数插入到Sql Azure中?

我正在研究一个批量插入数据的应用程序,以减less我想要使用Table Valued参数的查询数量。 例: var sql = require('node-sqlserver'); var connectionString = 'Driver={SQL Server Native Client 11.0};server=tcp:serverName.database.windows.net,1433;UID=user@serverName;PWD=password;Database={databaseName};Encrypt=yes;Connection Timeout=30;'; sql.open(connectionString, function(err, conn) { if(err) { return console.error('could not connect to sql', err); } var tableValuedObject = ???; var query = 'usp_InsertSomeTable ?'; conn.query(query, tableValuedObject, function(err, result) { if(err) { return console.error('error running insert', err); } }); }); 其中usp_InsertSomeTable被定义为 […]

使用NodeJS的Azure SQL

我在Azure中有一个暂存SQL数据库,我使用mssql节点模块连接到它。 我唯一的问题是Azure中的空闲连接策略。 闲置30分钟后,连接自动closures。 有没有人遇到同样的问题?

无法连接到数据库 – EADDRNOTAVAIL

我有一个简单的node.js应用程序无法连接到SQL Db。 Web服务器是Azure Web App,运行node.js并使用Tedious for SQL。 数据库是Azure SQL数据库。 这是详细的错误: {message:'无法连接到xxx.database.windows.net:1433 – undefined',代码:'ESOCKET'} 星期四2016年1月14日星期三08:05:05 GMT + 0000(世界协调时间):无任何exception:ConnectionError:连接丢失 – 在Connection处连接EADDRNOTAVAIL 。 (D:\ home \ site \ api \ node_modules \ tedious \ lib \ connection.js:797:26)。 (net.js:301:14)上的Socket.emit(events.js:88:20)上的(D:\ home \ site \ api \ node_modules \ tedious \ lib \ connection.js:33:15)在EventEmitter._tickCallback(node.js:190:38) 它适用于我的机器,有趣的是,这也适用于另一个Azure Web应用程序! 我试图重新启动这个networking应用程序,什么不…什么是这个错误的意思?

SQL Server枯燥的callback

我不能使用请求(这是一个INSERT请求)冗长的繁琐的callback在第一个请求之后发出另一个请求。 任何想法 ? 这是我的代码。 function intermediaryPositionSQL(decodeMessage, connection) { if (typeof (decodeMessage.latitudeInt) != "undefined" && typeof (decodeMessage.longitudeInt) != "undefined") { var request = new Request(requestPosQuery, function (error) { if (error) { winston.error(error); } }); request.addParameter('v_pos_latitude', TYPES.Float, decodeMessage.latitudeInt); request.addParameter('v_pos_longitude', TYPES.Float, decodeMessage.longitudeInt); request.addParameter('v_pos_altitude', TYPES.Int, (typeof (decodeMessage.altitude) != "undefined") ? decodeMessage.altitude : null); request.addParameter('v_pos_speed', TYPES.Int, (typeof (decodeMessage.speed) != "undefined") […]

Azure NPM问题:msnodesql无法部署

我试图用我的Azure托pipe网站设置msnodesql(以前称为node-sqlserver),并遇到一些问题。 本质上,我正在Azure中发生部署失败。 我相信这是由于NPM试图在服务器上安装msnodesql的事实,但是会失败,因为它需要安装Python和C ++ 2010的“node-gyp”(它不存在于Azure端)。 这是我看到的错误消息 npm ERR! msnodesql@0.2.0 install: `node-gyp rebuild` npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Failed at the msnodesql@0.2.0 install script. npm ERR! This is most likely a problem with the msnodesql package, npm ERR! not with npm itself. npm ERR! Tell the author that […]

无法用sequelize连接到SQL Azure数据库,但本地主机上的SQL Server工作正常

我已经用MongoDB部署了Heroku的几个站点,但是这是我第一次使用SQL创build站点并尝试部署到Azure,所以我可能会丢失一些明显的东西。 我一直在使用Node.js(SQL Server数据库)和Sequelize(作为ORM)开发我的开发机器上的网站。 一切工作正常,但是当我试图部署到连接string的Azure我无法连接到SQL Azure数据库。 我可以使用SQL Server Management Studio连接到Azure上的空数据库,所以我确定我的连接信息是正确的。 当我尝试部署到Azure时,我尝试使用Azure提供的连接string: var Sql = require('sequelize'); var sql = new Sql('Driver={SQL Server Native Client 11.0};Server=tcp:server.database.windows.net,1433;Database=databasename;Uid=UserName@server;Pwd={password};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;'); 当我尝试连接这个string时,我得到的错误是: C:\Users\username\Documents\GitHub\event-site\node_modules\sequelize\lib\sequelize.js:110 options.dialect = urlParts.protocol.replace(/:$/, ''); ^ TypeError: Cannot read property 'replace' of null at new Sequelize (C:\Users\v-mibowe\Documents\GitHub\event-site\node_modules\sequelize\lib\sequelize.js:110:40) at Object.<anonymous> (C:\Users\v-mibowe\Documents\GitHub\event-site\routes\db-routes.js:68:11) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at […]