diff --git a/lib/mssql.js b/lib/mssql.js index 3d42af1..3d7e4c9 100644 --- a/lib/mssql.js +++ b/lib/mssql.js @@ -294,7 +294,7 @@ MsSQL.prototype.updateAttributes = function (model, id, data, cb) { MsSQL.prototype.exists = function (model, id, callback) { var tblName = this.tableEscaped(model); var modelPKID = this._pkids[model]; - var sql = "SELECT COUNT(*) cnt FROM [dbo].[" + tblName + "] WHERE [" + modelPKID + "] = (@id)" + var sql = "SELECT COUNT(*) cnt FROM [dbo].[" + tblName + "] WHERE [" + modelPKID + "] = (@id)"; //console.log(sql); this.query(sql, new Parameters([{ name: "id", value: id }]), function (err, results) { if (err) return callback(err); @@ -835,7 +835,7 @@ MsSQL.prototype.singleIndexSettingsSQL = function (model, prop, add) { if (i.unique) { unique = true; } - var name = prop + "_" + kind + "_" + type + "_idx" + var name = prop + "_" + kind + "_" + type + "_idx"; if (i.name) { name = i.name; }