evaluate expression

Just curious. No reason really, it just occurred to me to ask. In vba you 
can use EVAL to evaluate an expression and in FoxPro you can use the 
EVALUATE() function. Is there such an animal in SQL 2005 or 2008  T-SQL? 


0
Keith
4/12/2010 11:34:57 PM
sqlserver.programming 1873 articles. 0 followers. Follow

3 Replies
672 Views

Similar Articles

[PageSpeed] 9

For SQL-Server, execution of dynamically build sql strings is allowed via 
the EXEC command or with the sp_sqlexec extended stored procedure.

-- 
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server 
(French)


"Keith G Hicks" <krh@comcast.net> wrote in message 
news:%23UhiIjp2KHA.1708@TK2MSFTNGP05.phx.gbl...
> Just curious. No reason really, it just occurred to me to ask. In vba you 
> can use EVAL to evaluate an expression and in FoxPro you can use the 
> EVALUATE() function. Is there such an animal in SQL 2005 or 2008  T-SQL?
> 


0
Sylvain
4/13/2010 12:10:04 AM
No, there is no direct equivalent to EVAL in SQL. As Sylvain noted dynamic SQL (more here: 
http://www.sommarskog.se/dynamic_sql.html) is similar, but not the same. EXEC and sp_executesql execute a query string 
but does not really evaluate an expression.

-- 
Plamen Ratchev
http://www.SQLStudio.com
0
Plamen
4/13/2010 1:27:55 AM
Thanks Plamen. I've written plenty of dsql (although per Erland's advice 
avoid it as much as possible) so I'm very familiar with EXEC but as you 
said, what's available in FoxPro and VBA is a little different. I actually 
had a situation today where I wanted to test some user input that can 
sometimes be a simple equation like "1+2" for example. I know I can't do 
EXEC('1+2') but I realzied I could do EXEC('SELECT 1+2'). Should never need 
to do that and I figured out a way to handle things better but I was just 
curious.

"Plamen Ratchev" <Plamen@SQLStudio.com> wrote in message 
news:GcSdnTMERscHVV7WnZ2dnUVZ_qgAAAAA@speakeasy.net...
> No, there is no direct equivalent to EVAL in SQL. As Sylvain noted dynamic 
> SQL (more here: http://www.sommarskog.se/dynamic_sql.html) is similar, but 
> not the same. EXEC and sp_executesql execute a query string but does not 
> really evaluate an expression.
>
> -- 
> Plamen Ratchev
> http://www.SQLStudio.com 


0
Keith
4/13/2010 3:02:43 AM
Reply:

Similar Artilces:

Outlook Express 6 and compacting
Hello... My boss is using a copy of Outlook Express 6 and everytime he closes the program it wants to compact the files....... Is this even a good idea and is there a way by which to turn off this option? thank you Stan Rudnick <stan@andrewslucia.com> wrote: > My boss is using a copy of Outlook Express 6 and everytime he closes > the program it wants to compact the files....... Is this even a > good idea and is there a way by which to turn off this option? Ask in an Outlook Express newsgroup. (In general, compacting is a good idea.) -- Brian Tillman Stan Rudn...

Downloadable evaluation version of Outlook 2003
does anyone know if it possible to get a downloadable version? Thanks.....Sly Sly wrote: > does anyone know if it possible to get a downloadable > version? > > Thanks.....Sly No. Not full Outlook, only Outlook Express is downloadable along with IE... >-----Original Message----- >does anyone know if it possible to get a downloadable >version? > >Thanks.....Sly >. > ...

Evaluating text as formulae
Is it possible to refer to text in a cell as though it were a formula, ie execute it instead of displaying it? Eg if the result of your formula was "A1 + B2", to actually add A1 and B2 and display the result? Thanks Nigel Like concatenating text? =concatenate(a1," + ",b2) or =concatenate(a1,b2) =concatenate(a1," ",b2) "Nigel Ramsden" wrote: > Is it possible to refer to text in a cell as though it were a formula, ie > execute it instead of displaying it? Eg if the result of your formula was > "A1 + B2", to actually add A1 and...

MS Office Outlook vs. Outlook Express 6
I am unable to receive e-mail directly to my Office Outlook. No matter what I do the e-mails keep coming to my outlook express. How can I have my e-mails routed directly to MS Office Outlook Thanks Pac 1) Make Outlook your default mail client in control panel, internet options, programs 2) Either remove your e-mail account from OE or don't open OE. Pac wrote: > I am unable to receive e-mail directly to my Office Outlook. No > matter what I do the e-mails keep coming to my outlook express. How > can I have my e-mails routed directly to MS Office Outlook? Thanks' > Pac y...

Have you evaluated...
Has anyone evaluated Celerant Command Retail or Tomax Retail.net POS solutions? How are they compared to RMS in terms of features and prices? ...

Outlook Express #131
I recieved this message when I tried to open an e-mail with an Excel worksheet "OE removed access to the following attachment" How can I change the settings to allow attachments to be downloaded? Many thanks for any help. dietrich(antispam)@htc.net ...

outlook express problems #3
Hello, I have just installed XP home edition on a HP pavilion a319.dk. After the installation I tried to create an e- mail account using outlook express, but with the result that the computer broke down in the frist step of creating the e-mail account. I tried to reinstall the computer but got the same problem again. Have anyone tried that before Thanks Claus This newsgroup is for support of Outlook 97, 98, 2000, 2002 & 2003 from the Office family for Intel PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpre...

Evaluate a Range
I would like to create a formula that looks at a range with a specified criterion and when it finds the first entry in that range that meets that criterion returns the position of that data in the range. For example, given the following data beginning in A1 and extending to D1: 5,7 ,8,11 I would like to create a formula that looks for a value greater than 10 in that range and then returns the number 4 to signify that it is the fourth entry in that range. Thanks as always for your help. --- Message posted from http://www.ExcelForum.com/ One way: Array enter (CTRL-SHIFT-ENTER or CMD-RET...

Pass form parameters to query expression
Hi All - Given: 1. Stand-alone Access 2003 mdb database. 2. Custom dialog form with two textboxes for user input (latitude & longitude). 3. btnOK on the form sets Me.Visible = False, but does not close the form. 4. A stored Select query based on an underlying table. 5. A controlling VBA procedure that opens the form, waits until btnOK is pressed, then continues executing. Question: Can the form variables ‘latitude’ and ‘longitude’ be passed from the open form (or from the controlling VBA procedure) to an expression in a query field of the stored query without using an SQL statement? ...

cells evaluation question
Hey I have a spreadsheet with 9 cells (c14:c22) They will have integers entered from 0 to 10 I need a formula to do the following: - Find how many have a value >=5 - Get the total value of the cells with a value >=5 Thanks Simon You want Countif and Sumif, as in: =countif(c14:c22,">=5") =sumif(c14:c22,">=5") Regards, Fred "Simon" <Simon@discussions.microsoft.com> wrote in message news:8D2F8EA3-D774-4A65-9157-274051900E28@microsoft.com... > Hey > > I have a spreadsheet with 9 cells (c14:c22) > They...

Auto email fill-in, Outlook Express does it
Hi Everyone, I'd like to start by saying thank for you taking the time to read this and offer any help. I just converted from Outlook Express 6 to Outlook 2000. Outlook Express 6 used to automatically fill in the potential email address that I was typing in after I typed the first few letters. With Outlook, I have to type in the full name or email address of the person - or click on To. I would like Outlook to work like Outlook Express did and just pop the email address in there and I could hit enter to select it. Is this possible?? It's such a minor change, but it'...

outlook express 5 to outlook
I use Outlook Express 5. The email server is http. I want to use Outlook 2000. If possible, how do I export settings and mail/address book from Outlook Express to Outlook 2000. The http server seems to be my problem. ...

multiple users in Outlook Express
Windows XP Outlook Express 6 Is it possible to allow multiple users (different logins) to access one Identity in Outlook Express 6? I would like all of my family to be able to use the email. We have only 1 email address provided by our ISP. My children as well as myself receive emails. At this point privacy within is not an issue. Thnaks. This newsgroup is for support of Outlook 97, 98, 2000, 2002 & 2003 from the Office family for Intel PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x micro...

Does IF() Evaluate in Pivot Table?
Is this function really evaluated in the calculated field of Pivo Table? IF(SALES > 10000,100,200) It always returns the value of the FALSE argument for the entir column -- Message posted from http://www.ExcelForum.com ...

Outlook Express?
Is Outlook Express covered in this group? I don't see another group for just Outlook Express. Thanks If you're accessing the Microsoft newsgroups through the MS Product Support Services "Community Newsgroups" web interface, you can find the Outlook Express groups listed under Internet Technologies, then Internet Explorer (by version number) Click the Outlook Express link to get to the group. Microsoft.public.outlook is for Outlook 97/98/2000/2002/2003beta from the Office suite of products. -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will p...

2002 evaluation.
Some time ago I ordered an evaluation copy of MS Publisher 2002. The CD came 2 days later, but that's when my hopes for a good evaluation ended. The thing won't install without a Product Key, which Microsoft never provided me with. During the installation I click on the appropriate link, but all I get is a polite info that the Key has been already sent to the e-mail provided, but will be re-sent. Guess what, it never came. I sent an e-mail to MS support asking for help. They replyed promptly with a car salesman like attitude, saying that they are dedicated to providing ...

sound for both outlook and outllook express
for win2k, outlook 2000, and outlook express 6.0 i can 'embed' a sound file in oe using the format|backround|sound, the sound is played by both oe and outlook i can 'insert' a sound file in outlook by 'inserting as text' html code/vbscript than invokes a sound file, (it actually seems to embed the sound file in letter) but if the email is received by an oe client the sound does not play, it only plays if opened by outlook so... is there some way to send an email with a sound file using outlook where the sound is also recognized/played by oe outlook is my preference,...

I need the difference between two dates expressed as 4 years 3 mo.
I need a way to subtract the difference between two dates and exprss the difference in a format simular to 10 years 6 months 7 days. Assume a start date of 12/19/1943 and an end date of Today(). I have no trouble using datedif to get the number of years as 61 years, months as 11. I have now idea of how to convert the total number of days between the two dates to the correct number days. sngNumDays = DateDiff("d", DateOne, Now) gives the total number of days (22657). My current Code: Private Sub cmdAge_Click() Dim DateOne As Date Dim intYears As Integer Dim int...

evaluate expression
Just curious. No reason really, it just occurred to me to ask. In vba you can use EVAL to evaluate an expression and in FoxPro you can use the EVALUATE() function. Is there such an animal in SQL 2005 or 2008 T-SQL? For SQL-Server, execution of dynamically build sql strings is allowed via the EXEC command or with the sp_sqlexec extended stored procedure. -- Sylvain Lafontaine, ing. MVP - Windows Live Platform Blog/web site: http://coding-paparazzi.sylvainlafontaine.com Independent consultant and remote programming for Access and SQL-Server (French) "Keith G Hic...

Outlook Express #156
My Outlook Express will no longer open attachments. Is there a setting or something some one has accidently changed that I can correct? ...

POP3/EarthLink Synchronization in Outlook Express
I am working with Windows XP and Outlook Express 6.0 and IE Ver 6.0 SP1. Periodically, I am unable to receive messages for my EarthLink account (however I have no problems receiving messages from my Hotmail account). I have started a dummy Outlook account (as I would like to keep using Outlook Express, as this is where all my addresses are located as well as message archives), and it seems to work OK with that. Any suggestions? Thanks, Tom ...

Outlook Express problem
I have 2 pc laptops in different rooms on a wired router. I share the internet signal through this and it works fine. A few months ago I upgraded one of the pcs to windows 7. Complete new install on reformatted discs and re-loaded my most important software. I did not like windows 7 much and found that a number of my most used programs did not work with it, so decided to go back to my old XP setup. Again I did a complete new install on clean drives etc. The problem is that since then, when I use Outlook express, the first machine that collects the emails somehow stops the other pc fro...

Outlook Express & Registry
Does anyone know what does it mean if the "Connection Type" key in the registry (in the outlook express account info in the registry) has a value of 0 ? I have an IMAP account on Win 2000, all the info is there, but the connection type is zero. This newsgroup is for support of Outlook 97, 98, 2000 & 2002 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x http://support.microsoft.com/newsgr...

Outlook with Outlook Express ?
Is it possible to select an Outlook Contact, and send an email using Outlook Express? Thanks. Talal Itani No. But you can do it vice versa. "Talal Itani" <titani@verizon.net> wrote in message news:TXaXh.4742$Fc1.4027@trnddc05... > > Is it possible to select an Outlook Contact, and send an email using > Outlook Express? > > Thanks. > Talal Itani > Talal Itani <titani@verizon.net> wrote: > Is it possible to select an Outlook Contact, and send an email using > Outlook Express? No, but you could open the Outlook Contact, select the e...

evaluate
I saw a worksheet for training programs in which this formula is written =IF(C5<1/1/1902,0,IF(C6>EDATE(C6,12),0,1)) can the function C6>EDATE(C6,12) can ever be true as the logic is refering to the same cell afd No, I don't see how that could ever be True. -- Rick (MVP - Excel) "afdmello" <afdmello@hotmail.com> wrote in message news:eXrWFES9KHA.3840@TK2MSFTNGP02.phx.gbl... > I saw a worksheet for training programs in which this formula is written > =IF(C5<1/1/1902,0,IF(C6>EDATE(C6,12),0,1)) > > can the function C6&g...