Reputation: 14600
insert into myTable (Id) values (
select id from someTable where seriesid not in (120, 130, 110, 300)
)
I get this error message in SSMS:
Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'select'. Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ')'.
Upvotes: 0
Views: 84
Reputation: 204854
If you perform a select
in an insert
then you may skip the values
part
insert into myTable (Id)
select id
from someTable
where seriesid not in (120, 130, 110, 300)
Upvotes: 5