Click here to Skip to main content
15,902,911 members
Home / Discussions / Database
   

Database

 
GeneralRe: Interesting question about a MIN function and usage Pin
Luc Pattyn29-Dec-09 0:57
sitebuilderLuc Pattyn29-Dec-09 0:57 
GeneralRe: Interesting question about a MIN function and usage Pin
James Shao29-Dec-09 4:24
James Shao29-Dec-09 4:24 
AnswerRe: Interesting question about a MIN function and usage [modified] Pin
Corporal Agarn29-Dec-09 4:30
professionalCorporal Agarn29-Dec-09 4:30 
GeneralRe: Interesting question about a MIN function and usage Pin
James Shao30-Dec-09 12:47
James Shao30-Dec-09 12:47 
GeneralRe: Interesting question about a MIN function and usage Pin
Corporal Agarn31-Dec-09 1:05
professionalCorporal Agarn31-Dec-09 1:05 
QuestionProblem with the french character with sql server 2005 Pin
pranavcool27-Dec-09 18:44
pranavcool27-Dec-09 18:44 
AnswerRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 1:33
sitebuilderLuc Pattyn28-Dec-09 1:33 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 2:24
professionalEddy Vluggen28-Dec-09 2:24 
GeneralRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 2:33
sitebuilderLuc Pattyn28-Dec-09 2:33 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 2:52
professionalEddy Vluggen28-Dec-09 2:52 
GeneralRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 3:09
sitebuilderLuc Pattyn28-Dec-09 3:09 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 6:34
professionalEddy Vluggen28-Dec-09 6:34 
AnswerRe: Problem with the french character with sql server 2005 [modified] Pin
Eddy Vluggen28-Dec-09 2:19
professionalEddy Vluggen28-Dec-09 2:19 
QuestionHelp me understand this unusual query... [modified] Pin
Rafferty Uy27-Dec-09 15:44
Rafferty Uy27-Dec-09 15:44 
Hi,

There was a small problem with our app where it allowed users to enter white-space only characters in one of the data fields. So now I'm trying to clean this up.
A colleague of mine sent me this unusual SQL query to find the whitespaces. The script looks like this:
SELECT tblId, ASCII(tblField1) AS 'ASCII Code', tblField1
FROM Table1
WHERE ASCII(LEFT(tblField1,1)) = 32

This query returned 40 rows.

Now, when I try either of the following:
SELECT tblId, ASCII(tblField1) AS 'ASCII Code', tblField1
FROM Table1
WHERE tblField1 = ' ' -- with a single whitespace

or
SELECT tblId, ASCII(tblField1) AS 'ASCII Code', tblField1
FROM Table1
WHERE tblField1 = '' -- empty string

The above 2 queries return 200,000+ rows.

Why is this so?

Rafferty

modified on Sunday, December 27, 2009 10:23 PM

AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 1:46
sitebuilderLuc Pattyn28-Dec-09 1:46 
QuestionRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 15:36
Rafferty Uy28-Dec-09 15:36 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 15:41
sitebuilderLuc Pattyn28-Dec-09 15:41 
QuestionRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 15:46
Rafferty Uy28-Dec-09 15:46 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 15:55
sitebuilderLuc Pattyn28-Dec-09 15:55 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 16:00
Rafferty Uy28-Dec-09 16:00 
GeneralRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 16:02
sitebuilderLuc Pattyn28-Dec-09 16:02 
AnswerRe: Help me understand this unusual query... Pin
WoutL28-Dec-09 21:24
WoutL28-Dec-09 21:24 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy29-Dec-09 15:34
Rafferty Uy29-Dec-09 15:34 
AnswerRe: Help me understand this unusual query... Pin
Member 450194029-Dec-09 5:47
Member 450194029-Dec-09 5:47 
QuestionNeed help with constructing one query statement [modified] Pin
James Shao27-Dec-09 3:43
James Shao27-Dec-09 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.