473,498 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Column naming/spacing

Is it possible to have spacing within a column name? Something like
"column name." I can do it from EM but won't let me do it in query
analyzer. Can someone tell me the command to do this in query
analyzer? Thanks!

Apr 18 '07 #1
1 1394
There are two ways to handle special characters (or reserved keywords) in
identifiers (databases, tables, other object names, etc.):
- using brackets [], like this (the example below includes some other
objects like database and table names with special characters):

SELECT [My Column] FROM [My~Database].[My^User^ID].[My$Table]
- using double quotation marks (this is the SQL-92 syntax), like this:

SELECT "My Column" FROM "My~Database"."My^User^ID"."My$Table"

In order to use the double quotation marks the QUOTED_IDENTIFIER option has
to be ON. You can do that in Query Analyzer by running:

SET QUOTED_IDENTIFIER ON
It is not a good practice to use special characters in identifiers as it
makes code difficult to read and maintain.

HTH,

Plamen Ratchev
http://www.SQLStudio.com
Apr 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11763
by: Matthew Crouch | last post by:
Does anyone know where I could find a consensus (in mysql community) on naming conventions? Is there a published standard? I mean primarily the naming of tables and fields. Obviously, people use...
4
1957
by: John.Arthur | last post by:
Hi, I am learning Ms Sql and I found that a lot of the tables I am finding ( in different tutorials ) are using special names for their column names such like au_username, au_salery ... Is the...
16
3432
by: Woodmon | last post by:
I want to flow text in an "irregular" column on the left and place a large image at the top of an "irregular" column to the right. Then after the bottom of the large image I want the text column on...
2
4734
by: Jef Driesen | last post by:
I'm working on a project where i need to exchange multidimensional data between C/C++ (row-major) and matlab (column-major). I understand the difference between those two mappings to linear memory....
10
11019
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way...
2
1236
by: Fir5tSight | last post by:
Hi, I have a stored procedure that looks like the follows: ------------------------------------------------------------------------------------- SELECT ClientName AS 'Client Name', Location,...
31
3041
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
1
4495
by: John | last post by:
Is there a way to change the cell spacing in a single column only? I want to set the cellspacing to zero in one of my columns. So far I only see the cellspacing attribute used with the <tabletag...
1
1162
by: KK | last post by:
Hello Everyone, i have a column named "Cell No" but when am trying to get data from it using query "select * from data where Cell No=?" it throws an error i know the problem is because of the...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.