File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
MssqlMcp/NodejsMcpServer/src/tools Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export class UpdateDataTool implements Tool {
2525 } as any ;
2626
2727 async run ( params : any ) {
28+ let query : string | undefined ;
2829 try {
2930 const { tableName, updates, whereClause } = params ;
3031
@@ -44,7 +45,7 @@ export class UpdateDataTool implements Tool {
4445 } )
4546 . join ( ", " ) ;
4647
47- const query = `UPDATE [ ${ tableName } ] SET ${ setClause } WHERE ${ whereClause } ` ;
48+ query = `UPDATE ${ tableName } SET ${ setClause } WHERE ${ whereClause } ` ;
4849 const result = await request . query ( query ) ;
4950
5051 return {
@@ -56,7 +57,7 @@ export class UpdateDataTool implements Tool {
5657 console . error ( "Error updating data:" , error ) ;
5758 return {
5859 success : false ,
59- message : `Failed to update data: ${ error } ` ,
60+ message : `Failed to update data ${ query ? ` with ' ${ query } '` : '' } : ${ error } ` ,
6061 } ;
6162 }
6263 }
You can’t perform that action at this time.
0 commit comments