I know mysql but I now have a job where mssql is needed. I am having a problem inerting multiple rows at once.

MySQL Query:

INSERT INTO colours
                      (ccode, cdesc)
VALUES     
('35', 'Green'), 
('35', 'Turquoise')

How do I get the same result with MSSQL?

Thanks in advance.

Found the answer.

INSERT INTO colours (ccode, cdesc)
SELECT 'code', 'desc'
UNION ALL
SELECT 'code2', 'desc2'
UNION ALL
SELECT 'code3', 'desc3'

Hope this helps somebody in the future.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.