473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

use of 'index' as a field name

Hello.

I'm working on an application where the original developer used the
field name 'index'. This works ok when accessing the table from MS
Access through query, but when I try to reference it via SQL with
either a statement from Enterprise Manager or a stored procedure I'm
getting an error because 'index' is a keyword.

Is there any way to reference this? Maybe some delimeters I can put
around it that I don't know about?

Thanks,
Stoney

Jul 23 '05 #1
4 1176

<rs*******@yahoo.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Hello.

I'm working on an application where the original developer used the
field name 'index'. This works ok when accessing the table from MS
Access through query, but when I try to reference it via SQL with
either a statement from Enterprise Manager or a stored procedure I'm
getting an error because 'index' is a keyword.

Is there any way to reference this? Maybe some delimeters I can put
around it that I don't know about?

Thanks,
Stoney


You can use brackets:

select [index]
from dbo.MyTable

See "Using Identifiers" and "Delimited Identifiers" in Books Online, as well
as "Reserved Keywords".

Simon
Jul 23 '05 #2
Perfect. Thanks.

When I tried it, I referenced it as:

[tablename.index]

That didn't work.

Thanks again,
Stoney

Jul 23 '05 #3

use
select [#mytest].[index],...
from #mytest

not
select [#mytest.index]...
from #mytest

hth,

victor dileo

Jul 23 '05 #4
(rs*******@yahoo.com) writes:
Perfect. Thanks.

When I tried it, I referenced it as:

[tablename.index]

That didn't work.


No, that would be an identifier with that very name with a period
in the middle of it. You use the quotes or brackets to delimit the
identifiers in a name.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5

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

Similar topics

0
by: Mike Coppinger | last post by:
I have a problem that has raised a couple of questions. SITUATION: I have a table called pr_persona that has a composite key comprising pr_persona_db CHAR(2) pr_persona_id INT(11) auto...
4
by: deko | last post by:
I have a Make Table query that creates a fairly large table. The Make Table query populates the new table with one AutoNumber field (which is taken form another unrelated table as part of the...
2
by: Kostas | last post by:
I ve been told from Allen and others that when enforcing referential integrity Access creates a hidden index for the foreign key, therefore, I do not need to re-index it myself. However, I...
10
by: hilz | last post by:
Hi all. I have a table that i create in MsAccess, using ado connection as follows: create table PAYITEM ( PAYITEM_ID COUNTER PRIMARY KEY, PAYITEM_NAME ...
10
by: deko | last post by:
I understand it's possible to make a composite Primary Key by holding down the control key and selecting multiple fields, then right-clicking and selecting Primary Key. But I've heard that's not a...
1
by: jhall | last post by:
At some point an index has been added to a table in my Access DB that does not allow duplicates. I can't see where I ever put an index on this field. But, when I tried to add 2nd records with a...
26
by: Craig Morrison | last post by:
I'm getting this: PHP Notice: Undefined index: D1 in /var/www/html..... From this line of code: $id_option = $_POST; Which is posted by this:
0
by: Sudhir Kesharwani | last post by:
Hi All, I am developing a custom grid view control, which displays a checkbox...grid control is bound to a datasource. i am writing a custom method for the datagrid, where in user can get...
8
by: zyzolus | last post by:
Hello, I create 2 unique indexes on 2 fields: Field1 and Field2. What is the way generate custom error message independent of each field?ex.: "Duplicate value in Field1" or "Duplicate value...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.