This seems really trivial, but for the life of me I cannot understand why this is not working. Any ideas would be great!
USE [ACCTQA]
GO
INSERT INTO [dbo].[glacct]
([Company]
,[Account]
,[Description])
VALUES
('E096','191802','INVESTMENT IN SUBS')
,('E096','320007','COMMON STOCK')
,('E096','330013','SURPLUS')
,('E096','340003','RETAINED EARNINGS')
,('E096','690876','LIAB & CASUALTY INS')
,('E096','710000','BONDS - AGENCY BILL')
,('E096','710001','COMM. P&C - AGENCY BILL')
,('E096','710002','EMPL BENEFITS-AGENCY BILL')
ERROR MSG:
Msg 102, Level 15, State 1, Line 8
Incorrect syntax near ','.
Try this
USE [ACCTQA]
GO
INSERT INTO [dbo].[glacct]
([Company]
,[Account]
,[Description])
SELECT * FROM (
SELECT 'E096','191802','INVESTMENT IN SUBS' UNION ALL
SELECT 'E096','320007','COMMON STOCK' UNION ALL
SELECT 'E096','330013','SURPLUS' UNION ALL
SELECT 'E096','340003','RETAINED EARNINGS'
.....)
I'm guessing your version is not accepting multiple values like this, so you have to use a select statement(INSERT FROM SELECT) to make it work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With