When I execute this code Syntax error is occured.
declare @category varchar(40);
declare @cat varchar(40);
SET @category='MotorCycle / ATV Audio(0)';
SET @cat = SELECT LEFT(''''+@category+'',CHARINDEX('(',''''+@category+'')-1)
Incorrect syntax near the keyword 'SELECT',
Error in SQL CODE
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Krishna GaradRank #191 · 12.8K reputationPosted Mar 6, 2011, 9:19 PM EST
declare @cat varchar(40);
SET @category='MotorCycle / ATV Audio(0)';
SET @cat = (SELECT LEFT(''''+@category+'',CHARINDEX('(',''''+@category+'')-1+')'))
PankaJ D147 reputationPosted Mar 6, 2011, 9:23 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Mar 6, 2011, 9:24 PM EST