Click here to Skip to main content
15,903,201 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Wildcard (%) query Pin
Joe Stansfield21-Dec-10 18:12
Joe Stansfield21-Dec-10 18:12 
GeneralRe: SQL Wildcard (%) query Pin
Luc Pattyn21-Dec-10 18:16
sitebuilderLuc Pattyn21-Dec-10 18:16 
GeneralRe: SQL Wildcard (%) query Pin
Joe Stansfield21-Dec-10 18:23
Joe Stansfield21-Dec-10 18:23 
AnswerRe: SQL Wildcard (%) query [modified] Pin
Luc Pattyn21-Dec-10 18:29
sitebuilderLuc Pattyn21-Dec-10 18:29 
GeneralRe: SQL Wildcard (%) query Pin
Joe Stansfield21-Dec-10 18:38
Joe Stansfield21-Dec-10 18:38 
GeneralRe: SQL Wildcard (%) query Pin
Luc Pattyn22-Dec-10 1:30
sitebuilderLuc Pattyn22-Dec-10 1:30 
AnswerRe: SQL Wildcard (%) query Pin
PIEBALDconsult22-Dec-10 3:38
mvePIEBALDconsult22-Dec-10 3:38 
AnswerRe: SQL Wildcard (%) query Pin
jschell23-Dec-10 8:04
jschell23-Dec-10 8:04 
Joe Stansfield wrote:
If I enter R%%, I will get all records.


And if you enter R%%% do you get no records?

Via SQL Server 2005 directly I am unable to replicate what you are seeing.

Joe Stansfield wrote:
I am using C# Visual Studio 2008 and the dataset query designer.


It is possible that the latter is the problem.

In Server 2005 (not the designer) I get exactly or at least close to the behaviour you describe when I use the underscore rather than the percent sign. Especially when you try the different input values.

Even if the SQL created excluded the percent signs from your where clause when you entered them manually it should still work. Instead with a single one you get only a single match. With two you get a two character match. That suggests the underline (single character match.)

Presuming there isn't some other assumption that is wrong - such as that you are actually running some other query because this one didn't get applied.

Simple test. Remove the percent entirely from the expression. Then test with input values: R, R_ and R%.
Those should give different results. If not then I would suspect that there is some other assumption that is causing the problem.
GeneralRe: SQL Wildcard (%) query Pin
Joe Stansfield5-Jan-11 11:53
Joe Stansfield5-Jan-11 11:53 
QuestionExtracting a blob data file from sqlite Pin
crain198121-Dec-10 13:35
crain198121-Dec-10 13:35 
AnswerRe: Extracting a blob data file from sqlite Pin
Luc Pattyn21-Dec-10 13:55
sitebuilderLuc Pattyn21-Dec-10 13:55 
GeneralRe: Extracting a blob data file from sqlite Pin
crain198121-Dec-10 14:34
crain198121-Dec-10 14:34 
AnswerRe: Extracting a blob data file from sqlite Pin
Luc Pattyn21-Dec-10 14:41
sitebuilderLuc Pattyn21-Dec-10 14:41 
GeneralRe: Extracting a blob data file from sqlite Pin
crain198121-Dec-10 15:04
crain198121-Dec-10 15:04 
GeneralRe: Extracting a blob data file from sqlite Pin
Luc 64801121-Dec-10 16:19
Luc 64801121-Dec-10 16:19 
GeneralRe: Extracting a blob data file from sqlite Pin
crain19818-Jan-11 5:27
crain19818-Jan-11 5:27 
QuestionIndex Fragmentation in Microsoft SQL Server [modified] Pin
Member 285321221-Dec-10 8:12
Member 285321221-Dec-10 8:12 
AnswerRe: Index Fragmentation in Microsoft SQL Server Pin
ScottM122-Dec-10 23:09
ScottM122-Dec-10 23:09 
Questionwrapper program Pin
kabir_2128920-Dec-10 19:11
kabir_2128920-Dec-10 19:11 
AnswerRe: wrapper program Pin
WoutL20-Dec-10 21:28
WoutL20-Dec-10 21:28 
AnswerRe: wrapper program Pin
Jörgen Andersson21-Dec-10 0:13
professionalJörgen Andersson21-Dec-10 0:13 
AnswerRe: wrapper program Pin
ScottM122-Dec-10 23:13
ScottM122-Dec-10 23:13 
QuestionMSSQL - How can I reference a column to update using a variable?? Pin
JTRizos20-Dec-10 9:01
JTRizos20-Dec-10 9:01 
AnswerRe: MSSQL - How can I reference a column to update using a variable?? Pin
PIEBALDconsult20-Dec-10 9:34
mvePIEBALDconsult20-Dec-10 9:34 
GeneralRe: MSSQL - How can I reference a column to update using a variable?? Pin
JTRizos20-Dec-10 11:12
JTRizos20-Dec-10 11:12 

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.