i have a a table called messages and a table called customer
I want to insert a new message in the message table for every customer ID in the customers table. I wrote the below query
INSERT INTO MESSAGES
(
ID,
VERSION,
CUSTOMERID,
SERVICE,
CREATED_BY,
MESSAGE
)
VALUES
(
NEWID(),
'1',
SELECT id FROM customer,
null,
'test',
'test')
But i get the error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Any ideas?