|
|
 |
| SQL Server 2005 General discussion of SQL Server *2005* version only. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

February 6th, 2007, 08:45 PM
|
|
Registered User
|
|
Join Date: Feb 2007
Location: Claymont, Delaware, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Select 'DIV' ??
I am new to SQL Server 2005. I am debugging a stored procedure that has a statement that starts with Select 'DIV' Region. What is DIV? I can't find it in the book and it is not a column in the table. Region is a column, DIV is not. Any ideas?????
Frank Bartkowski
__________________
Frank Bartkowski
|

February 6th, 2007, 10:19 PM
|
|
Wrox Author
Points: 13,101, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,079
Thanks: 1
Thanked 52 Times in 52 Posts
|
|
If the statement is literally:
SELECT 'DIV'
When you execute this in Query Analyzer it will literally return DIV as the output. So, essentially, you are selecting a String Literal through a query.
================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
|

February 9th, 2007, 11:06 AM
|
|
Authorized User
|
|
Join Date: Oct 2005
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
With the query you specified, even if Region is a column in your table, it is being replaced by the 'DIV' literal value in the output (not on the actual table). Region, in this case, is the column name in the output.
SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx
Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp
|

February 9th, 2007, 12:06 PM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Assuming you have the following Regions table with the following data:
RegionID, Region, blah, asdf
-------- ------ ---- ----
1 NW stuff stuff
2 SW stuff stuff
3 NE stuff stuff
4 SE stuff stuff
If you were to run the following query:
SELECT 'div' Region FROM Regions
You would get the following:
Region
------
div
div
div
div
Hope this helps...
Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |