Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign variable to CASE statement with nested variable

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
0
0
US
Hello,

I am trying to assign a variable in an insert into statement value as such:

@Base_ID = (CASE @Category_Type WHEN 'GENERAL' THEN 1 END)

I keep getting syntax errors so I know this is wrong. I've been searching for examples and cannot find this so if anyone could tell me what I'm doing wrong or steer me in the right direction i would greatly appreciate it.

Thanks,
Larry
 
I think you should post the whole code, not just the single line.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top