Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 June 21st, 2003, 03:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql server syntax problem

Hi all,

Please send the example of following sql query.
I could not understand the syntax of sql query.
table name is project
table field is contractno, contractid,image

TRIM, RTRIM, STR, SUBSTRING, SPACE,STUFF, CHARINDEX, etc.

regards.

Mateen Martin
mateenmohd@hotmail.com
Reply With Quote
  #2 (permalink)  
Old June 21st, 2003, 09:36 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Mateen,

What is it you need to do? What exactly is your question?

If you need to query something from a table, follow this SELECT syntax which you can find in the Books Online (BOL). An example:

SELECT Column1, Column2, Column3 FROM TableName WHERE Column1 = aValue

What are you trying to do with TRIM, RTRIM, STR, SUBSTRING, SPACE,STUFF, CHARINDEX?? These are functions you can use in your queries. For their usage, please look in the BOL.

Cheers,

Imar


----------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old June 23rd, 2003, 07:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mateen,

You have posted a lot of messages asking questions that would be quickly answered by examining the avilable documentation. It would be better if you checked the documentation before resorting the list.

In this case the documentation SQL Books Online (free to download if you don't already have it). There are very good examples of SELECT and TRIM, RTRIM, STR, SUBSTRING, SPACE, STUFF, CHARINDEX there.

regards
David Cameron
Reply With Quote
  #4 (permalink)  
Old June 23rd, 2003, 07:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just a small correction; SQL Server does not have a TRIM function. It does, however, have LTRIM and RTRIM, which respectively trim spaces from the left and right hand side of a character string. Nest these one inside the other to simulate the (VB) TRIM function.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
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
Sql Server Problem monika.vasvani SQL Server 2000 2 December 14th, 2006 03:09 PM
problem in with sql server Hussainrahmani ASP.NET 1.0 and 1.1 Basics 0 October 12th, 2005 06:04 PM
syntax problem with SQL nancy SQL Server 2000 4 May 6th, 2005 12:56 PM
syntax for storing chr(0) in sql server through vb neeraj.khattar Beginning VB 6 1 January 10th, 2005 02:20 PM
Problem with SQL Server ne0 All Other Wrox Books 1 August 6th, 2003 12:12 PM



All times are GMT -4. The time now is 09:44 PM.


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