Inserting Multiple Rows in Sybase ASE

后端 未结 4 1488
不知归路
不知归路 2021-01-18 12:11

(Similar question related to SQL Server : SO Link)

I know in Sql Server 2008 or above, you can insert multiple rows doing the following:

INSERT INTO          


        
4条回答
  •  失恋的感觉
    2021-01-18 12:32

    Looks like that syntax is not valid in Sybase ASE but as suggested in the linked SO post you can get the same using UNION ALL like

    INSERT INTO MyTable (Name, ID)
    SELECT 'First',1
    UNION ALL
    SELECT 'Second',2
    UNION ALL
    SELECT 'Third',3
    

提交回复
热议问题