Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Error in SQL CODE
PankaJ D
13y
2.2k
1
Reply
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',
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Create a copy of database
store procedure