3
Reply

Error in SQL CODE

PankaJ D

PankaJ D

Mar 7 2011 2:11 AM
2.2k
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', 


Answers (3)