Click here to Skip to main content
15,884,913 members
Home / Discussions / Database
   

Database

 
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 
AnswerRe: Need help with constructing one query statement Pin
Blue_Boy27-Dec-09 10:21
Blue_Boy27-Dec-09 10:21 
GeneralRe: Need help with constructing one query statement Pin
James Shao27-Dec-09 18:38
James Shao27-Dec-09 18:38 
AnswerCan anyone please help? Pin
James Shao28-Dec-09 12:13
James Shao28-Dec-09 12:13 
QuestionProblem installing MS SQL 2008 Express Pin
AndyASPVB26-Dec-09 22:26
AndyASPVB26-Dec-09 22:26 
AnswerRe: Problem installing MS SQL 2008 Express Pin
Roger Wright26-Dec-09 23:18
professionalRoger Wright26-Dec-09 23:18 
GeneralRe: Problem installing MS SQL 2008 Express Pin
AndyASPVB28-Dec-09 13:07
AndyASPVB28-Dec-09 13:07 

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.