Example 1: sql server insert multiple rows
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
...
(value_list_n);
Example 2: SQL Insert Multiple Rows
INSERT INTO StudentTable
( Rollo, Name, Class, Contact )
VALUES ( '1', 'Jonny', '10th', '9856245' ),
( '2', 'Ronny', '12th', '5421545' );
Example 3: insert more than 1000 rows sql
BEGIN TRY
BEGIN TRANSACTION
INSERT INTO OFBC_MD20_CC_Values (Column1, Column2, Column3, Column4, Column5, Cloumn6, Column7)
values('data1','data2','data3','data4','data5','data6','data7'),('data1','data2','data3','data4','data5','data6','data7')...
INSERT INTO OFBC_MD20_CC_Values (Column1, Column2, Column3, Column4, Column5, Cloumn6, Column7)
values('data1','data2','data3','data4','data5','data6','data7'),('data1','data2','data3','data4','data5','data6','data7')......
INSERT INTO OFta3','data4','data5','data6','dBC_MD20_CC_Values (Column1, Column2, Column3, Column4, Column5, Cloumn6, Column7)
values('data1','data2','daata7'),('data1','data2','data3','data4','data5','data6','data7')......
......Many time as needed
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRAN
DECLARE @ErrorMessage NVARCHAR(4000);
DECLARE @ErrorSeverity INT;
SELECT
@ErrorMessage = ERROR_MESSAGE(),
@ErrorSeverity = ERROR_SEVERITY();
THROW 51000, @ErrorMessage, 1
END CATCH