You are here: Re: Plz Help me out in this query « MsSQL Server « IT news, forums, messages
Re: Plz Help me out in this query

Posted by Helmut Woess on 11/18/06 13:04

Am 17 Nov 2006 05:22:51 -0800 schrieb Roni:
....
> Select Case(FORCE_HOLD_NDR)
> WHEN 1 THEN convert(DECIMAL(18,@i), Result)
> ELSE Result
> END
>>From MachineResults
>
> --Sounds really easy :) but its prompting me an Error
> --"Server: Msg 170, Level 15, State 1, Line 5
> --"Line 5: Incorrect syntax near '@i'."
>

This is not possible, you have to build a string and then execute this
string using EXECUTE or sp_executesql.
Here is an excellent article about it:
http://www.sommarskog.se/dynamic_sql.html

bye,
Helmut

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация