Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 113
sqlserver 94
BRH 78
#SQLServer 65
#TSQL 55
SQL Server 32
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2011 7
November 2007 7
November 2011 6
August 2011 6
October 2011 6
July 2011 6
September 2011 6
December 2011 6

Madhivanan's TSQL Blog

Question of the month February 2012 - Find out problamatic query

Feb 8 2012 1:03AM by Madhivanan   

Without running these queries can you find out the query that would throw an error?

1 select 7*-2&.3
2 select 7|2&-3
3 select 7+-(.2)%(+3)
4 select ((7&2%3))

Tags: t-sql, sql_server, sqlserver, tsql, question, puzzle,


Madhivanan
4 · 39% · 8773
4
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • Well, I referred BOL before answering. The bitwise AND (&) operator is compatible with the INT datatype only. It is not compatible with the NUMERIC data-type. Therefore query #1 will produce the error.

    Similarly, the following would also produce an error:

    select 7*-0.2&0.3
    
    commented on Feb 11 2012 12:13PM  .  Report Abuse This post is not formatted correctly
    Nakul Vachhrajani
    6 · 26% · 5867

Your Comment


Sign Up or Login to post a comment.

"Question of the month February 2012 - Find out problamatic query" rated 5 out of 5 by 4 readers
Question of the month February 2012 - Find out problamatic query , 5.0 out of 5 based on 4 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising