--- title: "addBatch Method (SQLServerStatement) | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual apiname: - "SQLServerStatement.addBatch" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: 95924a8b-a43c-4133-aff6-1d712e60e234 author: David-Engel ms.author: v-daenge --- # addBatch Method (SQLServerStatement) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Adds the given SQL command to the current list of commands for this [SQLServerStatement](../../../connect/jdbc/reference/sqlserverstatement-class.md) object. ## Syntax ``` public void addBatch(java.lang.String sql) ``` #### Parameters *sql* A **String** that contains an SQL statement. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks This addBatch method is specified by the addBatch method in the java.sql.Statement interface. ## See Also [SQLServerStatement Members](../../../connect/jdbc/reference/sqlserverstatement-members.md) [SQLServerStatement Class](../../../connect/jdbc/reference/sqlserverstatement-class.md)