INSERT INTO categories
(module_name, module_id, category_name)
VALUES ('articles',
(SELECT module_id
FROM modules
WHERE module_name = 'articles'), 'Category 1');
Note the addition of the () Around the subselect. technically, all subselects are supposed to be enclosed by () pairs.
I don't know if this will work for mssql though.