I am facing the famous \'Incorrect syntax\' while using a THROW statement in a T-SQL stored procedure. I have Googled it and checked the questions on StackOverf
To solve your problem,
Incorrect statement near 'THROW'. Expecting CONVERSATION, DIALOG, DISTRIBUTED, or TRANSACTION
put semi-colon before your throw statement:
BEGIN
;THROW 99001, 'O associated with the given Q Id already exists', 1;
END
And about the
"Incorrect statement near 'THROW'".
Try to use this in case you're using a older version than SQL 2012:
RAISERROR('O associated with the given Q Id already exists',16,1);
Because THROW is a new feature of SQL 2012.