I have a procedure that requires a string as input
CREATE PROCEDURE testing(MYVAR VARCHAR) AS
BEGIN
INSERT INTO mytable VALUES ( (SELECT id FROM articles), MYVAR ); --WRONG
The insert query is wrong, basically the table mytable has only 2 fields:
idarticles | variable
With the subquery I wanna select all the article ID and insert them as a pair with the MYVAR arg.
How can I do that?
Thanks
Try this:
It’s the same as including any other variable or constant, or literal in your
SELECTstatement: