Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 software programmers and website developers 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 developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 6th, 2007, 09:45 PM
Registered User
 
Join Date: Feb 2007
Location: Claymont, Delaware, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Frankb52258
Default 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
Reply With Quote
  #2 (permalink)  
Old February 6th, 2007, 11:19 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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^^
================================================== =========
Reply With Quote
  #3 (permalink)  
Old February 9th, 2007, 12:06 PM
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old February 9th, 2007, 01:06 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
z-index problem with select showing through div crmpicco CSS Cascading Style Sheets 3 July 4th, 2008 07:00 AM
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Set Div ID value = ttip_<xsl:value-of select='@nam ismailc XSLT 4 January 16th, 2008 05:04 AM
div within a div and inherting the height brettdavis4 CSS Cascading Style Sheets 1 January 23rd, 2007 09:59 AM
windowed object select shows through div crmpicco HTML Code Clinic 1 August 17th, 2005 01:50 AM



All times are GMT -4. The time now is 04:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.