p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Go Back   p2p.wrox.com Forums > SQL Server > SQL Server 2005 > SQL Server 2005
I forgot my password
Register Now
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 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 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
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
__________________
Frank Bartkowski
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 6th, 2007, 10:19 PM
Wrox Author
Points: 13,101, Level: 49
Points: 13,101, Level: 49 Points: 13,101, Level: 49 Points: 13,101, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,079
Thanks: 1
Thanked 52 Times in 52 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^^
================================================== =========
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old February 9th, 2007, 11:06 AM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old February 9th, 2007, 12:06 PM
SQLScott's Avatar
Wrox Author
Points: 1,121, Level: 13
Points: 1,121, Level: 13 Points: 1,121, Level: 13 Points: 1,121, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 1 Time in 1 Post
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 09:44 AM
Set Div ID value = ttip_<xsl:value-of select='@nam ismailc XSLT 4 January 16th, 2008 04:04 AM
div within a div and inherting the height brettdavis4 CSS Cascading Style Sheets 1 January 23rd, 2007 08: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 01:01 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc