Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 syntax error

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-10-04 : 02:38:26
i'm getting syntax error.....
please guide where it will be?

it is saying near case.

SELECT
CASE Column5
WHEN 1 THEN EXEC INSERT INTO '+#tbl+' SELECT Column2 FROM TABLE13
WHEN 2 THEN 'Item Type' -- TABLE11
WHEN 3 THEN 'Item Group' -- TABLE117
END
FROM TABLE90 WHERE Column3 = 1 AND Column4 = 1


Vinod
Even you learn 1%, Learn it with 100% confidence.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-04 : 02:42:10
[code]SELECT CASE Column5
WHEN 1 THEN 'EXEC INSERT INTO #tbl SELECT Column2 FROM Table13'
WHEN 2 THEN 'Item Type' -- TABLE11
WHEN 3 THEN 'Item Group' -- TABLE117
END
FROM Table90
WHERE Column3 = 1
AND Column4 = 1[/code]


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-10-04 : 02:43:59
thank you peso

Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -