Inserting Multiple Rows in Sybase ASE
- If you have came from SQL Server where you were using below to insert multiple rows:
INSERT INTO OTC..Employee_Test(Emp_name, Emp_Sal)
VALUES (‘JavaHonk’,1), (‘JavaHonk2’,2), (‘JavaHonk3’,3)
- But for Sybase database its little different to insert multiple rows and you can use as below:
INSERT INTO OTC..Employee_Test (Emp_name, Emp_Sal ) SELECT ‘JavaHonk’,1 UNION ALL SELECT ‘JavaHonk2’,2 UNION ALL SELECT ‘JavaHonk3’,3