Solved

Sql statment: Is this correct?

Posted on 2009-05-03
1
166 Views
Last Modified: 2012-05-06
"SELECT * FROM Order Details WHERE (OrderID) ='" + text + "'";

The thing is the Order Details. My lists name is that. Is it possible to have space in the word?
0
Comment
Question by:Mickeys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
tillgeffken earned 500 total points
ID: 24290431
Yes, it's not common (good) practice. Try changing your query to:

"SELECT * FROM [Order Details] WHERE OrderID ='" + text + "'";

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TSQL Query Into Specific XML Format w/ Multiple Groupings 6 45
Complex Query - help please 5 63
Stored Proc - Rewrite 42 73
SQL Select Query help 1 38
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question